Beispiel #1
0
        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>();
        }
Beispiel #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 <tbl_Claim> >();
            results.Count().Should().Be(UoW.Claims.Count());
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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>();
        }