Beispiel #1
0
 public void TestCallTestMethodWithNull()
 {
     using (var server = CreateServer())
         using (var client = new BasicServiceHttpClient())
         {
             server.Start();
             var result = client.TestMethod(null);
             Assert.IsNull(result);
         }
 }
Beispiel #2
0
        public void TestCallTestMethodWithDatabase()
        {
            using (var server = CreateServer())
                using (var client = new BasicServiceHttpClient())
                {
                    server.Start();
                    DAL.Database request  = NWindTests.LoadDatabaseFromFile <DAL.Database>();
                    DAL.Database response = client.TestMethod(request);

                    Assert.IsNotNull(response);
                    Assert.AreNotSame(request, response);

                    Assert.AreEqual(request.Orders.Count, response.Orders.Count, "Orders");
                    Assert.AreEqual(
                        request.Orders.SelectMany(ord => ord.Lines).Count(),
                        response.Orders.SelectMany(ord => ord.Lines).Count(), "Lines");
                    Assert.AreEqual(
                        request.Orders.SelectMany(ord => ord.Lines).Sum(line => line.Quantity),
                        response.Orders.SelectMany(ord => ord.Lines).Sum(line => line.Quantity), "Quantity");
                    Assert.AreEqual(
                        request.Orders.SelectMany(ord => ord.Lines).Sum(line => line.Quantity * line.UnitPrice),
                        response.Orders.SelectMany(ord => ord.Lines).Sum(line => line.Quantity * line.UnitPrice), "Value");
                }
        }
Beispiel #3
0
 public void TestCreateDisposeClient()
 {
     using (var client = new BasicServiceHttpClient()) { }
 }