Example #1
0
        public void TestAdd()
        {
            var characteristics        = new EditableCollection <Characteristic>();
            var wrappedCharacteristics =
                new WrappedEditableCollection <CharacteristicUsage, Characteristic>(characteristics);

            characteristics.Add(new Characteristic());

            wrappedCharacteristics.Count.Should().Be(characteristics.Count);
            wrappedCharacteristics.First().Characteristic.Should().Be(characteristics.First());

            var newCharacteristic        = new Characteristic();
            var newWrappedCharacteristic = new CharacteristicUsage(newCharacteristic);

            wrappedCharacteristics.Add(newWrappedCharacteristic);

            wrappedCharacteristics.Count.Should().Be(2);
            wrappedCharacteristics.Count.Should().Be(characteristics.Count);
            wrappedCharacteristics.First().Characteristic.Should().Be(characteristics.First());
            wrappedCharacteristics.Last().Characteristic.Should().Be(characteristics.Last());
        }