public void UnitTest_ValidateAccount_By_EmailAndPassword_Account_Not_Exist() { var dummyData = new List <usp_CheckStaffAccount_Result> { new usp_CheckStaffAccount_Result() { StaffID = 1, FirstName = "ABC", RoleID = 3 } }; var mockedObjectResult = new Mock <ObjectResult <usp_CheckStaffAccount_Result> >(); mockedObjectResult.Setup(x => x.GetEnumerator()).Returns(dummyData.GetEnumerator()); mockUnitOfWork.Setup(x => x.GetDB().usp_CheckStaffAccount("*****@*****.**", "pass")).Returns(mockedObjectResult.Object); StaffProvider provider = new StaffProvider(mockUnitOfWork.Object); var result = provider.ValidateStaffAccount(new Model.LoginDtoModel { Email = "*****@*****.**", Password = "******" }); Assert.IsNull(result); }