We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
foreach (var constructor in Class.Constructors.Where(c => c.IsCreatable)) { <text> @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginCancel_Simple")() { @Class.FullName objectUnderTest; try { objectUnderTest = @constructor.GetConstructorCode(); } catch (ArgumentException) { //OK return; } ((IEditableObject)objectUnderTest).BeginEdit(); ((IEditableObject)objectUnderTest).CancelEdit(); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginEnd_Simple")() { @Class.FullName objectUnderTest; try { objectUnderTest = @constructor.GetConstructorCode(); } catch (ArgumentException) { //OK return; } ((IEditableObject)objectUnderTest).BeginEdit(); ((IEditableObject)objectUnderTest).EndEdit(); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginCancel")() { @Class.FullName objectUnderTest; try { objectUnderTest = GetObject(1); } catch (ArgumentException) { //OK return; } var expected = GetValues(objectUnderTest); //CancelEdit should return us to these values ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 2); ((IEditableObject)objectUnderTest).CancelEdit(); var diffs = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs.Count"); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginEnd")() { @Class.FullName objectUnderTest; try { objectUnderTest = GetObject(1); } catch (ArgumentException) { //OK return; } ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 2); var expected = GetValues(objectUnderTest); //EndEdit shouldn't change any values ((IEditableObject)objectUnderTest).EndEdit(); var diffs = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs.Count"); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginBeginCancelCancel")() { @Class.FullName objectUnderTest; try { objectUnderTest = GetObject(1); } catch (ArgumentException) { //OK return; } var expected = GetValues(objectUnderTest); //The second CancelEdit should return us to these values ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 2); ((IEditableObject)objectUnderTest).BeginEdit(); //This is a no-op SetValues(objectUnderTest, 3); ((IEditableObject)objectUnderTest).CancelEdit(); //and we are back to the original values var diffs1 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs1.Count"); ((IEditableObject)objectUnderTest).CancelEdit(); //this is a no-op var diffs2 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs2.Count"); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginBeginCancelEnd")() { @Class.FullName objectUnderTest; try { objectUnderTest = GetObject(1); } catch (ArgumentException) { //OK return; } var expected = GetValues(objectUnderTest); //The first CancelEdit should return us to these values ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 2); ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 3); ((IEditableObject)objectUnderTest).CancelEdit(); var diffs1 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs1.Count"); ((IEditableObject)objectUnderTest).EndEdit(); //this is a no-op var diffs2 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs2.Count"); } @Tag("IEditableObject") @TestAttribute public void @(Test.ClassName + "_IEditableObject_" + constructor.SafeName + "_BeginBeginEndEnd")() { @Class.FullName objectUnderTest; try { objectUnderTest = GetObject(1); } catch (ArgumentException) { //OK return; } ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 2); ((IEditableObject)objectUnderTest).BeginEdit(); SetValues(objectUnderTest, 3); var expected = GetValues(objectUnderTest); ((IEditableObject)objectUnderTest).EndEdit(); var diffs1 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs1.Count"); ((IEditableObject)objectUnderTest).EndEdit(); var diffs2 = GetDiffs(expected, objectUnderTest); @Assert.AreEqual("0", "diffs2.Count"); } </text> }
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
}
The text was updated successfully, but these errors were encountered: