Example #1
0
        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>();
        }
Example #2
0
        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());
        }
Example #3
0
        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();
        }
Example #4
0
        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>();
        }