コード例 #1
0
        public async Task<ActionResult> Register(RegisterViewModel register)
        {
            // call Service
            IRegisterService registerService = new RegisterService();

            var datetime = DateTime.UtcNow;

            TempData["password"] = registerService.GeneratePassword(register.UserId, datetime);

            return RedirectToAction("Login");
        }
コード例 #2
0
        public void GeneratePassword_PositiveTest()
        {
            // arrange
            const string userId = "user1";
            const string expectedPassword = "******";
            var dateTime = new DateTime(2015, 6, 21, 9, 10, 10);
            RegisterService registerService = new RegisterService();

            // act
            var password = registerService.GeneratePassword(userId, dateTime);

            // assert
            Assert.AreEqual(expectedPassword, password);
        }