Esempio n. 1
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);
        }
Esempio n. 2
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());
        }