public void Contains_String_NoValidation() { var cfg = new TestConfig { SomeName = "Test for Domain features." }; var coll = new ConfigurationValidationCollector <TestConfig>(cfg); coll.ValidateContains(c => c.SomeName, "domain", "Should have domain!"); coll.Result.Should().NotBeNull(); coll.Result.Count.Should().Be(0); }
public void Contains_Empty_Validation() { var cfg = new TestConfig { SomeName = string.Empty }; var coll = new ConfigurationValidationCollector <TestConfig>(cfg); coll.ValidateContains(c => c.SomeName, "domain", "Should have domain!"); coll.Result.Should().NotBeNull(); coll.Result.Count.Should().Be(1); coll.Result[0].ConfigurationSection.Should().Be("TestConfig"); coll.Result[0].ConfigurationItem.Should().Be("SomeName"); coll.Result[0].ConfigurationValue.Should().Be(string.Empty); coll.Result[0].ValidationMessage.Should().Be("Should have domain!"); }