Exemple #1
0
        public void ThrowsWhenConfigSourceIsNull()
        {
            var factory = new FakeHosterFactory();
            var hoster  = new FakeHoster();

            factory.FakeHoster = hoster;

            var sut = new HosterValidator(factory);

            Assert.Throws <ArgumentNullException>(() => sut.Validate(null));
        }
Exemple #2
0
        public void ValidateCallsUnderlyingValidator()
        {
            var reader = new FakeConfigReader();

            reader.SetDefaultFakeConfig();
            var config = reader.ReadConfig();
            var source = config.Sources.First();

            var factory = new FakeHosterFactory();
            var hoster  = new FakeHoster();

            factory.FakeHoster = hoster;

            var sut = new HosterValidator(factory);

            sut.Validate(source);

            Assert.True(hoster.FakeValidator.WasValidated);
        }