Esempio n. 1
0
        public void TestThatLogWarningThrowsArgumentNullExceptionIfWarningIsEmpty()
        {
            var fixture = new Fixture();

            using (var informationLogger = new InformationLogger(GetPathForformationLogger()))
            {
                Assert.Throws <ArgumentNullException>(() => informationLogger.LogWarning(string.Empty));
                Assert.Throws <ArgumentNullException>(() => informationLogger.LogWarning(string.Empty, fixture.CreateMany <object>(5).ToArray()));
                informationLogger.Dispose();
            }
        }
Esempio n. 2
0
        public void TestThatLogWarningWritesWarningToLog()
        {
            var fixture = new Fixture();

            using (var informationLogger = new InformationLogger(GetPathForformationLogger()))
            {
                informationLogger.LogWarning(fixture.CreateAnonymous <string>());
                informationLogger.LogWarning("{0} {1} {2}", fixture.CreateAnonymous <string>(), fixture.CreateAnonymous <int>(), fixture.CreateAnonymous <object>());
                informationLogger.Dispose();
            }
            Assert.That(GetNumberOfLogFiles(), Is.EqualTo(1));
        }