public void LogText() { var obj = new Template(); obj.Name = "MyTemplate"; obj.Id = 42; obj.TemplateProperties = new List <TemplateProperty> { new TemplateProperty { key = "logText", type = "string" }, new TemplateProperty { key = "timeStamp", type = "datetime" } }; var s = new TemplateService(); var instance = new LoggerInstance(s); instance.ReceievedLogText += new LoggerInstance.ReceievedLogTextHandler(TestLogger.DebugWrite); var logString = "42,Hjaaaaeeeellp maj," + DateTime.Now; instance.LogText(logString); Assert.True(logString == TestLogger.result); }