public void Test_Getters_And_Setters() { List<Orderline> orderlines = new List<Orderline>(); Orderline OL1= new Orderline() {OrderId = 2, MovieId = 6, Amount = 6, Price = 30}; Orderline Ol2= new Orderline() {OrderId = 2, MovieId = 17, Amount = 8, Price = 30}; orderlines.Add(Ol2); orderlines.Add(OL1); Customer cust = new Customer() { Id = 1, FirstName = "Someone", MiddleName = "Else", LastName = "Name", Email = "*****@*****.**", StreetName = "Bla Vej", StreetNumber = 1, Password = "******" }; Status stat = new Status() { Id = 1, Name = "Shipped" }; Order Ord = new Order() {Id=1,Orderlines = orderlines, Customer = cust, OrderDate = DateTime.Now.Date, Status = stat}; Ord.Id = 1; Ord.Orderlines = orderlines; Ord.Customer = cust; Ord.OrderDate=DateTime.Now.Date; Ord.Status = stat; Assert.AreEqual(Ord.Id,1); Assert.AreEqual(Ord.Orderlines,orderlines); Assert.AreEqual(Ord.Customer,cust); Assert.AreEqual(Ord.OrderDate, DateTime.Now.Date); Assert.AreEqual(Ord.Status,stat); }
public void Test_Getters_And_Setters() { Status stat = new Status() {Id = 1, Name = "Shipped"}; stat.Id = 1; stat.Name = "Shipped"; Assert.AreEqual(stat.Id,1); Assert.AreEqual(stat.Name, "Shipped"); }