public void Repo_Claims_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <uvw_Issuer>() .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda()) .Single(); var result = UoW.Claims.Create( Mapper.Map <uvw_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 <uvw_Claim>(); }
public void Repo_Claims_GetV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var results = UoW.Claims.Get(); results.Should().BeAssignableTo <IEnumerable <uvw_Claim> >(); results.Count().Should().Be(UoW.Claims.Count()); }
public void Repo_Claims_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var claim = UoW.Claims.Get(QueryExpressionFactory.GetQueryExpression <uvw_Claim>() .Where(x => x.Type == TestDefaultConstants.ClaimName).ToLambda()) .Single(); UoW.Claims.Delete(claim); UoW.Commit(); }
public void Repo_Claims_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateClaims(); var claim = UoW.Claims.Get(QueryExpressionFactory.GetQueryExpression <uvw_Claim>() .Where(x => x.Type == TestDefaultConstants.ClaimName).ToLambda()) .Single(); claim.Value += "(Updated)"; var result = UoW.Claims.Update(claim); UoW.Commit(); result.Should().BeAssignableTo <uvw_Claim>(); }