Exemplo n.º 1
0
        public void TestAdd()
        {
            var properties = new PropertiesBufferList();

            properties.Properties.Should().BeEmpty();

            properties.Add(Core.Properties.Created);
            properties.Properties.Should().Equal(new object[] { Core.Properties.Created });

            properties.SetValue(Core.Properties.Created, new DateTime(2021, 02, 14, 12, 13, 01));
            new Action(() => properties.Add(Core.Properties.Created)).Should().NotThrow("because adding properties again should be tolerate and just not do anything");
            properties.Properties.Should().Equal(new object[] { Core.Properties.Created });
            properties.GetValue(Core.Properties.Created).Should().Be(new DateTime(2021, 02, 14, 12, 13, 01));
        }