public void GetAllUserTests_WithCorrectData_UserTestsMustBeReceived() { var uow = new Mock <IUnitOfWork>(); UserTestService uts = new UserTestService(uow.Object); uow.Setup(x => x.UserTests.GetAll()).Returns(new List <UserTest>()); uow.Setup(x => x.Tests.GetAll()).Returns(new List <Test>()); uow.Setup(x => x.Users.GetAll()).Returns(new List <User>()); var expected = JsonConvert.SerializeObject(new List <UserTest>()); var actual = JsonConvert.SerializeObject(uts.GetAllUserTests()); Assert.Equal(expected, actual); }