Exemplo n.º 1
0
        public void WriteTrace_works()
        {
            string result  = null;
            var    handler = new OperationLogHandler(writeTrace: m => result = m);
            var    message = "Princess Celestia is an alicorn.";

            handler.WriteTrace(message);

            Assert.Equal(message, result);
        }
Exemplo n.º 2
0
        public void WriteInformation_works()
        {
            string result  = null;
            var    handler = new OperationLogHandler(writeInformation: m => result = m);
            var    message = "Princess Celestia is on her way.";

            handler.WriteInformation(message);

            Assert.Equal(message, result);
        }
Exemplo n.º 3
0
        public void WriteDebug_works()
        {
            string result  = null;
            var    handler = new OperationLogHandler(writeDebug: m => result = m);
            var    message = "Princess Celestia is a princess.";

            handler.WriteDebug(message);

            Assert.Equal(message, result);
        }
Exemplo n.º 4
0
        public void Write_methods_are_noops_when_null()
        {
            var handler = new OperationLogHandler();

            handler.WriteError("Princess Celestia does not exist.");
            handler.WriteWarning("Princess Celestia is in danger.");
            handler.WriteInformation("Princess Celestia is on her way.");
            handler.WriteDebug("Princess Celestia is a princess.");
            handler.WriteTrace("Princess Celestia is an alicorn.");
        }
Exemplo n.º 5
0
        public void WriteError_works()
        {
            string result  = null;
            var    handler = new OperationLogHandler(writeError: m => result = m);
            var    message = "Princess Celestia does not exist.";

            handler.WriteError(message);

            Assert.Equal(message, result);
        }
        public void WriteDebug_works()
        {
            string result = null;
            var handler = new OperationLogHandler(writeDebug: m => result = m);
            var message = "Princess Celestia is a princess.";

            handler.WriteDebug(message);

            Assert.Equal(message, result);
        }
        public void WriteVerbose_works()
        {
            string result = null;
            var handler = new OperationLogHandler(writeVerbose: m => result = m);
            var message = "Princess Celestia is an alicorn.";

            handler.WriteVerbose(message);

            Assert.Equal(message, result);
        }
        public void WriteInformation_works()
        {
            string result = null;
            var handler = new OperationLogHandler(writeInformation: m => result = m);
            var message = "Princess Celestia is on her way.";

            handler.WriteInformation(message);

            Assert.Equal(message, result);
        }
        public void WriteError_works()
        {
            string result = null;
            var handler = new OperationLogHandler(writeError: m => result = m);
            var message = "Princess Celestia does not exist.";

            handler.WriteError(message);

            Assert.Equal(message, result);
        }
        public void Write_methods_are_noops_when_null()
        {
            var handler = new OperationLogHandler();

            handler.WriteError("Princess Celestia does not exist.");
            handler.WriteWarning("Princess Celestia is in danger.");
            handler.WriteInformation("Princess Celestia is on her way.");
            handler.WriteVerbose("Princess Celestia is an alicorn.");
            handler.WriteDebug("Princess Celestia is a princess.");
        }