public void PolicemanInserted() { //Arange mockPolicemanRepository.Setup(x => x.InsertPoliceman(policeman)).Returns(1); this.policemanBusiness = new PolicemanBusiness(mockPolicemanRepository.Object); //Act var result = policemanBusiness.InsertPoliceman(policeman); //Asert Assert.IsTrue(result); }
public void GetAllPolicemen() { //Arange listOfPoliceman.Add(new Policeman { Id = 1, Name = "Djordje", Surname = "Obradovic", JMBG = "1210994741520", Gender = "Muski", Shift = "Druga", Status = "Odsutan" }); listOfPoliceman.Add(new Policeman { Id = 1, Name = "Djordje", Surname = "Obradovic", JMBG = "1210994741520", Gender = "Muski", Shift = "Druga", Status = "Odsutan" }); listOfPoliceman.Add(new Policeman { Id = 1, Name = "Djordje", Surname = "Obradovic", JMBG = "1210994741520", Gender = "Muski", Shift = "Druga", Status = "Odsutan" }); mockPolicemanRepository.Setup(x => x.GetAllPolicemen()).Returns(listOfPoliceman); policemanBusiness = new PolicemanBusiness(mockPolicemanRepository.Object); //Act var result = policemanBusiness.GetAllPolicemen(); //Assert Assert.AreEqual(3, result.Count); }