public void Read_NotThrowsException_StateIsValid() { var authorizationCodeKey = new AuthorizationCodeTableEntity { CodeId = "normal", }; var authorizationCodeRepository = new AuthorizationCodeRepository(TestEnvironment.DBSettings); var authorizationCode = authorizationCodeRepository.Read(authorizationCodeKey); Assert.IsNotNull(authorizationCode); }
public void Update_NotThrowsException_StateIsValid() { var authorizationCodeKey = new AuthorizationCodeTableEntity { CodeId = "normal", }; var authorizationCodeRepository = new AuthorizationCodeRepository(TestEnvironment.DBSettings); var authorizationCode = authorizationCodeRepository.Read(authorizationCodeKey); authorizationCode.UpdateTime = DateUtil.Now; Assert.IsTrue(authorizationCodeRepository.Update(authorizationCode)); }
public void Create_NotThrowsException_StateIsValid() { var now = DateUtil.Now; var authorizationCode = new AuthorizationCodeTableEntity { CodeId = new string('X', 100), ApplicationId = Guid.NewGuid(), AccountId = Guid.NewGuid(), Status = AuthorizationCodeStatus.NORMAL.ToString(), ExpiryTime = DateTimeOffset.MaxValue, CreateTime = DateTimeOffset.MaxValue, UpdateTime = DateTimeOffset.MaxValue, }; var authorizationCodeRepository = new AuthorizationCodeRepository(TestEnvironment.DBSettings); authorizationCodeRepository.Create(authorizationCode); }