Example #1
0
        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());
        }
Example #2
0
        public void AddField_Null_DoesNothing()
        {
            var testGroupBase = new TestGroup_InheritsGroupBase();

            testGroupBase.AddField(null);
            Assert.Empty(testGroupBase.Fields);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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());
        }