public async void ReadUser_Valid_TypeOfUser_Test() { //Arrange _adapterMock.Setup(r => r.Read(_user.Id)).Returns(Task.FromResult(_user)); var userHandler = new UserHandler(_adapterMock.Object); //Act var user = await userHandler.Read(_user.Id); //Assert Assert.IsInstanceOfType(user, typeof (User)); }
public async void ReadUser_Valid_CorrectInformation_Test() { //Arrange _adapterMock.Setup(r => r.Read(_user.Id)).Returns(Task.FromResult(_user)); var userHandler = new UserHandler(_adapterMock.Object); //Act var actualUser = await userHandler.Read(_user.Id); //Assert Assert.IsTrue(actualUser.Id == _user.Id); Assert.IsTrue(actualUser.Name == _user.Name); Assert.IsTrue(actualUser.MetaData == _user.MetaData); }
public void ReadUser_Valid_IsNotNull_Test() { //Arrange _adapterMock.Setup(r => r.Read(_user.Id)).Returns(Task.FromResult(_user)); var userHandler = new UserHandler(_adapterMock.Object); //Act var user = userHandler.Read(_user.Id); //Assert Assert.IsNotNull(user); }