Example #1
0
        public void TestClear()
        {
            var properties             = new PropertiesBufferList();
            var sourceCannotBeAccessed = new SourceDoesNotExist("wdawdwaw.txt");

            properties.SetValue(Core.Properties.EmptyReason, sourceCannotBeAccessed);
            properties.SetValue(Core.Properties.PercentageProcessed, Percentage.Of(50, 100));

            properties.Clear();
            properties.Properties.Should().BeEmpty();
            properties.GetValue(Core.Properties.EmptyReason).Should().Be(Core.Properties.EmptyReason.DefaultValue);
            properties.GetValue(Core.Properties.PercentageProcessed).Should().Be(Core.Properties.PercentageProcessed.DefaultValue);

            properties.TryGetValue(Core.Properties.EmptyReason, out _).Should().BeFalse();
            properties.TryGetValue(Core.Properties.PercentageProcessed, out _).Should().BeFalse();
        }