public void MyTestCleanup() { if (service != null) { service.Abort(); service = null; } }
static void Main(string[] args) { var easyService = new EasyService(); easyService.OnServiceStarted += () => { Console.WriteLine("Hello World!"); File.WriteAllText("C:\\exampleFile.txt", "Hello World!"); }; easyService.Run(args); }
public void GetCalResult2Test() { //arrange var esSut = new EasyService(); var expected = 10; //act var actual = esSut.GetCalResult2(); //assert Assert.AreEqual(expected, actual); }
public void EasyService() { var service = new EasyService("MyFirstService") .Debuggable() .At("http://localhost:8080/") .WithOperation("HelloWorld") .Calls((string name) => "Hello " + name); using (service) { service.Open(); using (var cf = new ChannelFactory<IMyFirstService>(new BasicHttpBinding(), "http://localhost:8080/")) { var result = cf.CreateChannel().HelloWorld("alex"); Assert.AreEqual("Hello alex", result); } service.Close(); } }