本文整理汇总了C#中Facade.GetCustomerRepo方法的典型用法代码示例。如果您正苦于以下问题:C# Facade.GetCustomerRepo方法的具体用法?C# Facade.GetCustomerRepo怎么用?C# Facade.GetCustomerRepo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facade
的用法示例。
在下文中一共展示了Facade.GetCustomerRepo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Customer_added_on_call_test
public void Customer_added_on_call_test()
{
Customer temp = new Customer()
{
FirstName = "Test Olesen",
Address = "Testvej 3",
BirthDate = DateTime.Now.AddYears(-1),
Email = "[email protected]",
PhoneNumber = 12345678
};
Facade facade = new Facade();
temp = facade.GetCustomerRepo().Add(temp);
facade = new Facade();
Assert.IsNotNull(facade.GetCustomerRepo().Get(temp.Id));
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).FirstName, temp.FirstName);
}
示例2: Customer_get_all_return_many_test
public void Customer_get_all_return_many_test()
{
Customer temp = new Customer()
{
FirstName = "Test Olesen",
Address = "Testvej 3",
BirthDate = DateTime.Now.AddYears(-1),
Email = "[email protected]",
PhoneNumber = 12345678
};
Facade facade = new Facade();
facade.GetCustomerRepo().Add(temp);
facade.GetCustomerRepo().Add(temp);
facade = new Facade();
Assert.GreaterOrEqual(facade.GetCustomerRepo().GetAll().ToList().Count,2);
}
示例3: Login_add_creates_on_call_using_get_test
public void Login_add_creates_on_call_using_get_test()
{
Facade facace = new Facade();
Customer cusOne = new Customer()
{
FirstName = "Jonas Olesen",
Address = "Møbelvej 3",
BirthDate = DateTime.Now.AddYears(-20),
Email = "[email protected]",
PhoneNumber = 22755692
};
cusOne = facace.GetCustomerRepo().Add(cusOne);
Login login = new Login() { Customer = cusOne, Password = "testpass", Username = "testUser" + Id++ };
login = facace.GetLoginRepo().Add(login);
facace = new Facade();
Assert.AreEqual(facace.GetLoginRepo().Get(login.Username).Password, login.Password);
}
示例4: Order_added_on_create_test
public void Order_added_on_create_test()
{
Facade facade = new Facade();
Customer cus = new Customer()
{
FirstName = "Test",
Address = "TestAddress",
BirthDate = DateTime.Now,
Email = "TestEmail",
PhoneNumber = 1234
};
cus = facade.GetCustomerRepo().Add(cus);
Genre genre = new Genre() { Name = "TestGenre" };
List<Genre> list = new List<Genre>();
genre = facade.GetGenreRepo().Add(genre);
list.Add(genre);
Movie movie = new Movie()
{
Name = "TestName",
Genres = list,
Price = 123,
TrailerURL = "TestURL"
};
movie = facade.GetMovieRepo().Add(movie);
Order order = new Order()
{
Customer = cus,
Date = DateTime.Now
};
OrderMovie om = new OrderMovie() { Movie = movie, Order = order };
om = facade.GetOrderMovieRepo().Add(om);
order.OrderMovie.Add(om);
order = facade.GetOrderRepo().Add(order);
facade = new Facade();
Assert.AreEqual(order.Customer.FirstName, facade.GetOrderRepo().Get(order.Id).Customer.FirstName);
}
示例5: Customer_get_by_id_working_test
public void Customer_get_by_id_working_test()
{
Customer temp = new Customer()
{
FirstName = "Test Olesen",
Address = "Testvej 3",
BirthDate = DateTime.Now.AddYears(-1),
Email = "[email protected]",
PhoneNumber = 12345678
};
Facade facade = new Facade();
temp = facade.GetCustomerRepo().Add(temp);
facade = new Facade();
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).FirstName, temp.FirstName);
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).Address, temp.Address);
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).Email, temp.Email);
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).PhoneNumber, temp.PhoneNumber);
}
示例6: Login_getall_returns_multiple_test
public void Login_getall_returns_multiple_test()
{
Facade facade = new Facade();
Customer cusOne = new Customer()
{
FirstName = "Jonas Olesen",
Address = "Møbelvej 3",
BirthDate = DateTime.Now.AddYears(-20),
Email = "[email protected]",
PhoneNumber = 22755692
};
cusOne = facade.GetCustomerRepo().Add(cusOne);
Login login = new Login() { Customer = cusOne, Password = "testpass", Username = "testuser"+Id++ };
facade.GetLoginRepo().Add(login);
Login login2 = new Login() { Customer = cusOne, Password = "testpass", Username = "testuser"+Id++ };
facade.GetLoginRepo().Add(login2);
facade = new Facade();
Assert.GreaterOrEqual(facade.GetLoginRepo().GetAll().ToList().Count, 2);
}
示例7: Customer_remove_removes_from_database_test
public void Customer_remove_removes_from_database_test()
{
Customer temp = new Customer()
{
FirstName = "Test Olesen",
Address = "Testvej 3",
BirthDate = DateTime.Now.AddYears(-1),
Email = "[email protected]",
PhoneNumber = 12345678
};
Facade facade = new Facade();
temp = facade.GetCustomerRepo().Add(temp);
facade = new Facade();
facade.GetCustomerRepo().Remove(temp.Id);
facade = new Facade();
Assert.IsNull(facade.GetCustomerRepo().Get(temp.Id));
}
示例8: Customer_add_throws_exception_on_customer_name_equals_null_test
public void Customer_add_throws_exception_on_customer_name_equals_null_test()
{
Facade facade = new Facade();
facade.GetCustomerRepo().Add(new Customer());
}
示例9: Customer_update_works_test
public void Customer_update_works_test()
{
Customer temp = new Customer()
{
FirstName = "Test Olesen",
Address = "Testvej 3",
BirthDate = DateTime.Now.AddYears(-1),
Email = "[email protected]",
PhoneNumber = 12345678
};
Facade facade = new Facade();
temp = facade.GetCustomerRepo().Add(temp);
facade = new Facade();
temp.FirstName = "Changed";
Assert.IsTrue(facade.GetCustomerRepo().Update(temp));
facade = new Facade();
Assert.AreEqual(facade.GetCustomerRepo().Get(temp.Id).FirstName, "Changed");
}
示例10: Customer_update_throws_exception_on_customer_equals_null_test
public void Customer_update_throws_exception_on_customer_equals_null_test()
{
Facade facade = new Facade();
facade.GetCustomerRepo().Update(null);
}
示例11: Customer_update_returns_false_on_customer_name_equals_null_test
public void Customer_update_returns_false_on_customer_name_equals_null_test()
{
Facade facade = new Facade();
Assert.IsFalse(facade.GetCustomerRepo().Update(new Customer()));
}
示例12: Customer_remove_throws_exception_on_customer_equals_null_test
public void Customer_remove_throws_exception_on_customer_equals_null_test()
{
Facade facade = new Facade();
facade.GetCustomerRepo().Remove(-1);
}
示例13: Order_getorderbycustomer_returns_multiple_test
public void Order_getorderbycustomer_returns_multiple_test()
{
Facade facade = new Facade();
Customer cus = new Customer()
{
BirthDate = DateTime.Now,
FirstName = "jonas",
Address ="hest",
Email = "hest"
};
cus = facade.GetCustomerRepo().Add(cus);
Order orderOne = new Order() { Customer = cus, Date = DateTime.Now, OrderMovie = new List<OrderMovie>() };
Order orderTwo = new Order() { Customer = cus, Date = DateTime.Now, OrderMovie = new List<OrderMovie>() };
orderOne = facade.GetOrderRepo().Add(orderOne);
orderTwo = facade.GetOrderRepo().Add(orderTwo);
facade = new Facade();
Assert.GreaterOrEqual(facade.GetOrderRepo().GetOrdersByCustomer(cus).ToList().Count, 2);
}
示例14: Login_get_customer_by_login_returns_right_customer_test
public void Login_get_customer_by_login_returns_right_customer_test()
{
Facade facade = new Facade(); Customer cusOne = new Customer()
{
FirstName = "Jonas Olesen",
Address = "Møbelvej 3",
BirthDate = DateTime.Now.AddYears(-20),
Email = "[email protected]",
PhoneNumber = 22755692
};
cusOne = facade.GetCustomerRepo().Add(cusOne);
Login login = new Login() { Customer = cusOne, Password = "testpass", Username = "testuser"+Id++ };
login = facade.GetLoginRepo().Add(login);
Assert.AreEqual(facade.GetLoginRepo().GetCustomerByLoginUsername(login.Username).FirstName, login.Customer.FirstName);
}
示例15: Login_remove_removes_from_db_test
public void Login_remove_removes_from_db_test()
{
Facade facade = new Facade();
Customer cusOne = new Customer()
{
FirstName = "Jonas Olesen",
Address = "Møbelvej 3",
BirthDate = DateTime.Now.AddYears(-20),
Email = "[email protected]",
PhoneNumber = 22755692
};
cusOne = facade.GetCustomerRepo().Add(cusOne);
Login login = new Login() { Customer = cusOne, Password = "testpass", Username = "testuser" + Id++ };
login = facade.GetLoginRepo().Add(login);
facade = new Facade();
facade.GetLoginRepo().Remove(login.Username);
facade = new Facade();
Assert.IsNull(facade.GetLoginRepo().Get(login.Username));
}