Ejemplo n.º 1
0
 public void MyTestCleanup()
 {
     if (service != null)
     {
         service.Abort();
         service = null;
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public void GetCalResult2Test()
        {
            //arrange
            var esSut    = new EasyService();
            var expected = 10;

            //act
            var actual = esSut.GetCalResult2();

            //assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        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();
            }
        }