示例#1
0
        public void MemeberShipService_IsUserRegisteredNoUserFound()
        {
            _userRepository.Setup(e => e.FindUser(It.Is <string>(p => p == "test")));
            MemeberShipService memeberShipService = new MemeberShipService(_userRepository.Object);

            var result = memeberShipService.IsUserRegistered("test");

            Assert.IsFalse(result);
            _userRepository.Verify(e => e.FindUser("test"), Times.Once);
        }
示例#2
0
        public void MemeberShipService_IsUserRegisteredNoUserName()
        {
            _userRepository.Setup(e => e.FindUser(It.Is <string>(p => p == "test"))).Returns(new User
            {
                DeviceRegistrations = new Collection <Device>
                {
                    new Device()
                }
            });
            MemeberShipService memeberShipService = new MemeberShipService(_userRepository.Object);

            var result = memeberShipService.IsUserRegistered("");

            Assert.IsFalse(result);
            _userRepository.Verify(e => e.FindUser("test"), Times.Never);
        }