Ejemplo n.º 1
0
        public void MemeberShipService_GenerateServerRegistrationNoUserName()
        {
            MemeberShipService memeberShipService = new MemeberShipService(_userRepository.Object);

            var result = memeberShipService.GenerateServerRegistration("", "password");

            Assert.IsNull(result);
        }
Ejemplo n.º 2
0
        public void MemeberShipService_GenerateServerRegistration()
        {
            _userRepository.Setup(e => e.AddUser(It.Is <string>(p => p == "test"), It.IsAny <string>()));
            _userRepository.Setup(e => e.AddAuthenticationRequest(It.Is <string>(p => p == "test"), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()));
            MemeberShipService memeberShipService = new MemeberShipService(_userRepository.Object);

            var result = memeberShipService.GenerateServerRegistration("test", "password");

            Assert.IsNotNull(result);
            _userRepository.Verify(e => e.AddAuthenticationRequest(It.Is <string>(p => p == "test"), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()), Times.Once);
        }