public void Create() { UnityResolver.Register(); IBranchManager BranchManager = UnityResolver.Resolve <IBranchManager>(); Branch branch = new Branch { BranchName = "TestBranch", Address = "Panadura", TelNo = 12, Institute = new Common.Models.Institute { InstituteName = "Test Institute" } }; bool ans = BranchManager.Create(branch); BranchManager.Save(); Branch branch1 = BranchManager.Find(B => B.Address == "Panadura"); string expected = "Panadura"; string actual = branch1.Address; Assert.AreEqual(expected, actual); }
public void Find() { UnityResolver.Register(); IBranchManager BranchManager = UnityResolver.Resolve <IBranchManager>(); Branch branch1 = BranchManager.Find(B => B.BranchId == 92); string expected = "Panadura"; string actual = branch1.Address; Assert.AreEqual(expected, actual); }
public void Delete() { UnityResolver.Register(); IBranchManager BranchManager = UnityResolver.Resolve <IBranchManager>(); Branch branch = BranchManager.Find(B => B.BranchId == 115); bool ans = BranchManager.Delete(branch); BranchManager.Save(); bool expected = true; bool actual = ans; Assert.AreEqual(expected, actual); }