Esempio n. 1
0
        public void WriteTrace()
        {
            using (var verifier = new MessageTester())
            {
                verifier.Reset();
                Log.TraceVerbose("This is a call to Log.TraceVerbose with no arguments");
                Log.TraceVerbose("This is a call to Log.TraceVerbose with two arguments #1:{0}, #2:{1}", 1, 2);
                Log.TraceVerbose(new AssertionException("This is our test trace exception"),
                                 "This is a call to Log.TraceVerbose with no arguments");
                Log.TraceVerbose(new AssertionException("This is our test trace exception"),
                                 "This is a call to Log.TraceVerbose with two arguments #1:{0}, #2:{1}", 1, 2);
                verifier.WaitForMessages();
                Assert.That(verifier.VerboseCount, Is.EqualTo(4));

                verifier.Reset();
                Log.TraceInformation("This is a call to Log.TraceInformation with no arguments");
                Log.TraceInformation("This is a call to Log.TraceInformation with two arguments #1:{0}, #2:{1}", 1, 2);
                Log.TraceInformation(new AssertionException("This is our test trace information exception"),
                                     "This is a call to Log.TraceInformation with no arguments");
                Log.TraceInformation(new AssertionException("This is our test trace information exception"),
                                     "This is a call to Log.TraceInformation with two arguments #1:{0}, #2:{1}", 1, 2);
                verifier.WaitForMessages();
                Assert.That(verifier.InfoCount, Is.EqualTo(4));

                verifier.Reset();
                Log.TraceWarning("This is a call to Log.TraceWarning with no arguments");
                Log.TraceWarning("This is a call to Log.TraceWarning with two arguments #1:{0}, #2:{1}", 1, 2);
                Log.TraceWarning(new AssertionException("This is our test trace warning exception"),
                                 "This is a call to Log.TraceWarning with no arguments");
                Log.TraceWarning(new AssertionException("This is our test trace warning exception"),
                                 "This is a call to Log.TraceWarning with two arguments #1:{0}, #2:{1}", 1, 2);
                verifier.WaitForMessages();
                Assert.That(verifier.WarningCount, Is.EqualTo(4));

                verifier.Reset();
                Log.TraceError("This is a call to Log.TraceError with no arguments");
                Log.TraceError("This is a call to Log.TraceError with two arguments #1:{0}, #2:{1}", 1, 2);
                Log.TraceError(new AssertionException("This is our test trace error exception"),
                               "This is a call to Log.TraceError with no arguments");
                Log.TraceError(new AssertionException("This is our test trace error exception"),
                               "This is a call to Log.TraceError with two arguments #1:{0}, #2:{1}", 1, 2);
                verifier.WaitForMessages();
                Assert.That(verifier.ErrorCount, Is.EqualTo(4));

                verifier.Reset();
                Log.TraceCritical("This is a call to Log.TraceCritical with no arguments");
                Log.TraceCritical("This is a call to Log.TraceCritical with two arguments #1:{0}, #2:{1}", 1, 2);
                Log.TraceCritical(new AssertionException("This is our test trace critical exception"),
                                  "This is a call to Log.TraceCritical with no arguments");
                Log.TraceCritical(new AssertionException("This is our test trace critical exception"),
                                  "This is a call to Log.TraceCritical with two arguments #1:{0}, #2:{1}", 1, 2);
                verifier.WaitForMessages();
                Assert.That(verifier.CriticalCount, Is.EqualTo(4));
            }
        }
Esempio n. 2
0
 void OnStateReceived(State state)
 {
     Debug.Log(
         "Receiving state for turn: " + state.turnCount + " Players: " + state.players.Length + "\n" +
         "Cash: " + state.me.cash +
         " Position: " + state.me.position +
         " Roll: " + MessageTester.ArrayString(state.me.roll) +
         " Houses: " + MessageTester.ArrayString(state.me.houses) +
         " Hotels: " + MessageTester.ArrayString(state.me.hotels) +
         " PossibleActions: " + state.me.possibleActions.Length +
         " Transactions: " + state.me.transactions.Length
         );
 }
Esempio n. 3
0
        private void MessageTester_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var messageTesterDlg = new MessageTester();

            messageTesterDlg.Show();
        }
Esempio n. 4
0
        public void RunTesters()
        {
            MessageTester messageTester = new MessageTester();

            messageTester.Run();
        }
 public LoupeProviderLoggingTests()
 {
     _sut           = new LoggerExecutionWrapper(new LoupeLogProvider().GetLogger("Test"));
     _messageTester = new MessageTester();
 }