예제 #1
0
            public void Should_return_null_when_email_notExist()
            {
                //Arrange
                var   existingUserId = 6;
                Email email          = null;

                EmailRepositoryMock
                .Setup(i => i.ReadOneAsync(existingUserId))
                .ReturnsAsync(email);

                //Act
                var result = ContactServiceUnderTest.ReadOneEmailAsync(existingUserId);

                //Assert
                Assert.Null(result.Result);
            }
예제 #2
0
            public void Should_return_null_when_phone_notExist()
            {
                //Arrange
                var   existingUserId = 6;
                Phone phone          = null;

                PhoneRepositoryMock
                .Setup(i => i.ReadOneAsync(existingUserId))
                .ReturnsAsync(phone);

                //Act
                var result = ContactServiceUnderTest.ReadOnePhoneAsync(existingUserId);

                //Assert
                Assert.Null(result.Result);
            }
예제 #3
0
            public void Should_return_Email_when_user_Id_exist()
            {
                //Arrange
                var existingUserId = 6;
                var expectedEmail  = EmailData;

                EmailRepositoryMock
                .Setup(i => i.ReadOneAsync(existingUserId))
                .ReturnsAsync(expectedEmail);

                //Act
                var result = ContactServiceUnderTest.ReadOneEmailAsync(existingUserId);

                //Assert
                Assert.Same(expectedEmail, result.Result);
            }
예제 #4
0
            public void Should_return_Phone_when_user_Id_exist()
            {
                //Arrange
                var existingUserId = 6;
                var expectedPhone  = PhoneData;

                PhoneRepositoryMock
                .Setup(i => i.ReadOneAsync(existingUserId))
                .ReturnsAsync(expectedPhone);

                //Act
                var result = ContactServiceUnderTest.ReadOnePhoneAsync(existingUserId);

                //Assert
                Assert.Same(expectedPhone, result.Result);
            }