Ejemplo n.º 1
0
        /// <summary>Anies the given request.</summary>
        ///
        /// <param name="request">The request.</param>
        ///
        /// <returns>An object.</returns>
		public object Any(StoreCustomers request)
		{
			db.CreateTable<Customer>(false);
			foreach (var customer in request.Customers)
			{
				db.Insert(customer);
			}

			return null;
		}
Ejemplo n.º 2
0
		private static void StoreAndGetCustomers(ServiceController serviceController)
		{
			var storeCustomers = new StoreCustomers {
				Customers = {
	            	new Customer { Id = 1, FirstName = "First", LastName = "Customer" },
	            	new Customer { Id = 2, FirstName = "Second", LastName = "Customer" },
	            }
			};
			serviceController.Execute(storeCustomers);

			storeCustomers = new StoreCustomers {
				Customers = {
					new Customer {Id = 3, FirstName = "Third", LastName = "Customer"},
				}
			};
			serviceController.Execute(storeCustomers);

			var response = serviceController.Execute(new GetCustomer { CustomerId = 2 });

			Assert.That(response as GetCustomerResponse, Is.Not.Null);

			var customer = ((GetCustomerResponse)response).Customer;
			Assert.That(customer.FirstName, Is.EqualTo("Second"));
		}