예제 #1
0
        public void With_EventLogSink_Write_throw_exception_when_no_logEntry_is_null()
        {
            var eventLog = new EventLog()
            {
                Source = "AutomataTestsSource",
                Log    = "AutomataTestsLog"
            };

            var eventLogSink = new SystemEventLog(eventLog);

            Assert.ThrowsException <ArgumentNullException>(() =>
            {
                eventLogSink.Write(null);
            });
        }
예제 #2
0
        public void With_EventLogSink_Write_does_not_throw_an_exception()
        {
            var eventLog = new EventLog()
            {
                Source = "AutomataTestsSource",
                Log    = "AutomataTestsLog"
            };

            var eventLogSink = new SystemEventLog(eventLog);

            try
            {
                eventLogSink.Write(LogEntry.Entry("Hello World"));
                Assert.IsTrue(true);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }