public void AddField_GroupContainsField_DoesNothing() { var testGroupBase = new TestGroup_InheritsGroupBase(); var field = new Field("TestField"); testGroupBase.AddField(field); Assert.Contains(field, testGroupBase.Fields); Assert.Equal(1, testGroupBase.Fields.Count()); testGroupBase.AddField(field); Assert.Contains(field, testGroupBase.Fields); Assert.Equal(1, testGroupBase.Fields.Count()); }
public void AddField_Null_DoesNothing() { var testGroupBase = new TestGroup_InheritsGroupBase(); testGroupBase.AddField(null); Assert.Empty(testGroupBase.Fields); }
public void AddField_GroupDoesNotContainField_AddsFieldToGroup() { var group = new TestGroup_InheritsGroupBase(); var field = new Field("TestField"); Assert.Empty(group.Fields); group.AddField(field); Assert.Contains(field, group.Fields); }
public void RemoveField_GroupContainsField_FieldRemovedFromGroup() { var testGroupBase = new TestGroup_InheritsGroupBase(); var field = new Field("TestField"); testGroupBase.AddField(field); Assert.Contains(field, testGroupBase.Fields); Assert.Equal(1, testGroupBase.Fields.Count()); testGroupBase.RemoveField(field); Assert.DoesNotContain(field, testGroupBase.Fields); Assert.Empty(testGroupBase.Fields); }
public void RemoveField_GroupDoesNotContainField_DoesNothing() { var testGroupBase = new TestGroup_InheritsGroupBase(); var addedField = new Field("TestField"); var otherField = new Field("OtherField"); testGroupBase.AddField(addedField); Assert.Contains(addedField, testGroupBase.Fields); Assert.Equal(1, testGroupBase.Fields.Count()); testGroupBase.RemoveField(otherField); Assert.DoesNotContain(otherField, testGroupBase.Fields); Assert.Contains(addedField, testGroupBase.Fields); Assert.Equal(1, testGroupBase.Fields.Count()); }