public void GetPartnerCustmer_Positive() { int PartnerId = 394; var MockRoomBusiness = new Mock <RoomManager>(); var returnAckType = new Acknowledgement <User> { code = 1, Set = null, Message = "Successfully Displayed", }; var customers = new GetCustomerOfPartners() { PartnerId = 394, UserId = 392, RoomId = 610, RoomType = "flat", UserAddress = "Hyderabad", UserEmail = "*****@*****.**", UserName = "******", UserPhoneNumber = "9987657689" }; List <GetCustomerOfPartners> par = new List <GetCustomerOfPartners>(); par.Add(customers); MockRoomBusiness.Setup(p => p.GetCustomer(PartnerId)).Returns(par); RoomsController roomsController = new RoomsController(MockRoomBusiness.Object); var actualReturnType = roomsController.GetCustomer(PartnerId) as OkObjectResult; Assert.ReferenceEquals(returnAckType, actualReturnType.Value); }