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_Issuers_GetV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateIssuers(); var results = UoW.Issuers.Get(); results.Should().BeAssignableTo <IEnumerable <tbl_Issuer> >(); results.Count().Should().Be(UoW.Issuers.Count()); }
public void Repo_Issuers_UpdateV1_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(); issuer.Name += "(Updated)"; var result = UoW.Issuers.Update(issuer); UoW.Commit(); result.Should().BeAssignableTo <tbl_Issuer>(); }
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>(); }