public void Repo_Issuers_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateIssuers(); var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <tbl_Issuer>() .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda()) .Single(); var claims = UoW.Claims.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Claim>() .Where(x => x.IssuerId == issuer.Id).ToLambda()); var refreshes = UoW.Refreshes.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Refresh>() .Where(x => x.IssuerId == issuer.Id).ToLambda()); var settings = UoW.Settings.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Setting>() .Where(x => x.IssuerId == issuer.Id).ToLambda()); var states = UoW.States.Delete(QueryExpressionFactory.GetQueryExpression <tbl_State>() .Where(x => x.IssuerId == issuer.Id).ToLambda()); var roles = UoW.Roles.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Role>() .Where(x => x.Audience.IssuerId == issuer.Id).ToLambda()); var audiences = UoW.Audiences.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Audience>() .Where(x => x.IssuerId == issuer.Id).ToLambda()); UoW.Issuers.Delete(issuer); UoW.Commit(); }
public void Repo_Claims_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <tbl_Issuer>() .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda()) .Single(); var result = UoW.Claims.Create( Mapper.Map <tbl_Claim>(new ClaimV1() { IssuerId = issuer.Id, Subject = TestDefaultConstants.ClaimSubject, Type = TestDefaultConstants.ClaimName, Value = AlphaNumeric.CreateString(8), ValueType = TestDefaultConstants.ClaimValueType, IsDeletable = false, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Claim>(); }
public void Repo_Refreshes_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUserRefreshes(); var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <tbl_Issuer>() .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda()) .Single(); var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>() .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda()) .Single(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()) .Single(); var result = UoW.Refreshes.Create( Mapper.Map <tbl_Refresh>(new RefreshV1() { IssuerId = issuer.Id, AudienceId = audience.Id, UserId = user.Id, RefreshType = ConsumerType.User.ToString(), RefreshValue = Base64.CreateString(8), ValidFromUtc = DateTime.UtcNow, ValidToUtc = DateTime.UtcNow.AddSeconds(60), })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Refresh>(); }
public void Repo_Refreshes_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUserRefreshes(); var refresh = UoW.Refreshes.Get().First(); UoW.Refreshes.Delete(refresh); UoW.Commit(); }
public void Repo_Users_GetV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUsers(); var results = UoW.Users.Get(); results.Should().BeAssignableTo <IEnumerable <tbl_User> >(); results.Count().Should().Be(UoW.Users.Count()); }
public void Repo_States_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUserStates(); var state = UoW.States.Get().First(); UoW.States.Delete(state); UoW.Commit(); }
public void Repo_TextQueue_GetV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateTexts(); var results = UoW.TextQueue.Get(); results.Should().BeAssignableTo <IEnumerable <tbl_TextQueue> >(); results.Count().Should().Be(UoW.TextQueue.Count()); }
public void Repo_EmailQueue_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateEmails(); var email = UoW.EmailQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_EmailQueue>().ToLambda()) .First(); UoW.EmailQueue.Delete(email); UoW.Commit(); }
public void Repo_Users_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUsers(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()).Single(); UoW.Users.Delete(user); UoW.Commit(); }
public void Repo_TextQueue_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateTexts(); var text = UoW.TextQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_TextQueue>().ToLambda()) .First(); UoW.TextQueue.Delete(text); UoW.Commit(); }
public void Repo_MOTDs_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateMOTDs(); var MOTD = UoW.MOTDs.Get(QueryExpressionFactory.GetQueryExpression <tbl_MOTD>() .Where(x => x.Author == TestDefaultConstants.MOTDAuthor).ToLambda()) .First(); UoW.MOTDs.Delete(MOTD); UoW.Commit(); }
public void Repo_Claims_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var claim = UoW.Claims.Get(QueryExpressionFactory.GetQueryExpression <tbl_Claim>() .Where(x => x.Type == TestDefaultConstants.ClaimName).ToLambda()) .Single(); UoW.Claims.Delete(claim); UoW.Commit(); }
public void Repo_Roles_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <tbl_Role>() .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda()) .Single(); UoW.Roles.Delete(role); UoW.Commit(); }
public void Repo_Logins_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateLogins(); var login = UoW.Logins.Get(QueryExpressionFactory.GetQueryExpression <tbl_Login>() .Where(x => x.Name == TestDefaultConstants.LoginName).ToLambda()) .Single(); UoW.Logins.Delete(login); UoW.Commit(); }
public void Repo_TextQueue_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateTexts(); var text = UoW.TextQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_TextQueue>().ToLambda()) .First(); text.Body += "(Updated)"; var result = UoW.TextQueue.Update(text); UoW.Commit(); result.Should().BeAssignableTo <tbl_TextQueue>(); }
public void Repo_MOTDs_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateMOTDs(); var result = UoW.MOTDs.Create( Mapper.Map <tbl_MOTD>(new MOTDTssV1 { author = TestDefaultConstants.MOTDAuthor, quote = "Quote-" + Base64.CreateString(4), })); UoW.Commit(); result.Should().BeAssignableTo <tbl_MOTD>(); }
public void Repo_EmailQueue_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateEmails(); var email = UoW.EmailQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_EmailQueue>().ToLambda()) .First(); email.Subject += "(Updated)"; var result = UoW.EmailQueue.Update(email); UoW.Commit(); result.Should().BeAssignableTo <tbl_EmailQueue>(); }
public void Repo_Logins_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateLogins(); var result = UoW.Logins.Create( Mapper.Map <tbl_Login>(new LoginV1() { Name = TestDefaultConstants.LoginName, LoginKey = TestDefaultConstants.LoginKey, IsDeletable = false, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Login>(); }
public void Repo_Logins_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateLogins(); var login = UoW.Logins.Get(QueryExpressionFactory.GetQueryExpression <tbl_Login>() .Where(x => x.Name == TestDefaultConstants.LoginName).ToLambda()) .Single(); login.Name += "(Updated)"; var result = UoW.Logins.Update(login); UoW.Commit(); result.Should().BeAssignableTo <tbl_Login>(); }
public void Repo_Users_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUsers(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()).Single(); user.FirstName += "(Updated)"; user.LastName += "(Updated)"; var result = UoW.Users.Update(user); UoW.Commit(); result.Should().BeAssignableTo <tbl_User>(); }
public void Repo_Claims_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var claim = UoW.Claims.Get(QueryExpressionFactory.GetQueryExpression <tbl_Claim>() .Where(x => x.Type == TestDefaultConstants.ClaimName).ToLambda()) .Single(); claim.Value += "(Updated)"; var result = UoW.Claims.Update(claim); UoW.Commit(); result.Should().BeAssignableTo <tbl_Claim>(); }
public void Repo_MOTDs_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateMOTDs(); var MOTD = UoW.MOTDs.Get(QueryExpressionFactory.GetQueryExpression <tbl_MOTD>() .Where(x => x.Author == TestDefaultConstants.MOTDAuthor).ToLambda()) .First(); MOTD.Quote += "(Updated)"; var result = UoW.MOTDs.Update(MOTD); UoW.Commit(); result.Should().BeAssignableTo <tbl_MOTD>(); }
public void Repo_Roles_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <tbl_Role>() .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda()) .Single(); role.Name += "(Updated)"; var result = UoW.Roles.Update(role); UoW.Commit(); result.Should().BeAssignableTo <tbl_Role>(); }
public void Repo_Issuers_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateIssuers(); var result = UoW.Issuers.Create( Mapper.Map <tbl_Issuer>(new IssuerV1() { Name = TestDefaultConstants.IssuerName, IssuerKey = TestDefaultConstants.IssuerKey, IsEnabled = true, IsDeletable = false, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Issuer>(); }
public void Repo_States_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateUserStates(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()) .Single(); var state = UoW.States.Get(QueryExpressionFactory.GetQueryExpression <tbl_State>() .Where(x => x.UserId == user.Id).ToLambda()) .First(); state.StateConsume = true; var result = UoW.States.Update(state); UoW.Commit(); result.Should().BeAssignableTo <tbl_State>(); }
public void Repo_TextQueue_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateTexts(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()) .First(); var result = UoW.TextQueue.Create( Mapper.Map <tbl_TextQueue>(new TextV1() { FromPhoneNumber = TestDefaultConstants.UserPhoneNumber, ToPhoneNumber = TestDefaultConstants.UserPhoneNumber, Body = "Body-" + Base64.CreateString(32), SendAtUtc = DateTime.UtcNow, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_TextQueue>(); }
public void Repo_Audiences_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateAudiences(); var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <tbl_Issuer>() .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda()) .Single(); var result = UoW.Audiences.Create( Mapper.Map <tbl_Audience>(new AudienceV1() { IssuerId = issuer.Id, Name = TestDefaultConstants.AudienceName, IsLockedOut = false, IsDeletable = true, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Audience>(); }
public void Repo_EmailQueue_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateEmails(); var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <tbl_User>() .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda()) .First(); var result = UoW.EmailQueue.Create( Mapper.Map <tbl_EmailQueue>(new EmailV1() { FromEmail = user.EmailAddress, ToEmail = user.EmailAddress, Subject = "Subject-" + AlphaNumeric.CreateString(4), Body = "Body" + AlphaNumeric.CreateString(4), })); UoW.Commit(); result.Should().BeAssignableTo <tbl_EmailQueue>(); }
public void Repo_Roles_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>() .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda()) .Single(); var result = UoW.Roles.Create( Mapper.Map <tbl_Role>(new RoleV1() { AudienceId = audience.Id, Name = TestDefaultConstants.RoleName, IsEnabled = true, IsDeletable = false, })); UoW.Commit(); result.Should().BeAssignableTo <tbl_Role>(); }