public void BarFindByID() { //setup ManagerController mc = new ManagerController(); Manager manager = new Manager("TestName", "TestPhonenumber", "TestEmail", "TestUsername", null); Manager m = mc.CreateManager(manager, "TestPassword"); Country country = LocationDB.Instance.getCountryById(1); if (country is null) { Assert.Fail("Country is null"); } Zipcode zip = LocationDB.Instance.findZipById(1); Address a = new Address("TestVej", zip); zip.Country = country; a.Zipcode = zip; Bar bar = new Bar { Address = a, Email = "TestBarEmail", Name = "TestBarName", PhoneNumber = "TestBarP", Username = "******" }; Bar barCreated = controller.Create(bar, m.Id, "TestPassword"); //act Bar barFound = controller.Find(barCreated.ID); //Assert Assert.AreEqual(barCreated, barFound, "Bar wasn't found"); }
public Bar Find(int barId) { return(barController.Find(barId)); }