Beispiel #1
0
        public void Repo_Audiences_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudiences();

            var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>()
                                             .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda())
                           .Single();

            UoW.AuthActivity.Delete(QueryExpressionFactory.GetQueryExpression <tbl_AuthActivity>()
                                    .Where(x => x.AudienceId == audience.Id).ToLambda());

            UoW.Refreshes.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Refresh>()
                                 .Where(x => x.AudienceId == audience.Id).ToLambda());

            UoW.Settings.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Setting>()
                                .Where(x => x.AudienceId == audience.Id).ToLambda());

            UoW.States.Delete(QueryExpressionFactory.GetQueryExpression <tbl_State>()
                              .Where(x => x.AudienceId == audience.Id).ToLambda());

            UoW.Roles.Delete(QueryExpressionFactory.GetQueryExpression <tbl_Role>()
                             .Where(x => x.AudienceId == audience.Id).ToLambda());

            UoW.Audiences.Delete(audience);
            UoW.Commit();
        }
Beispiel #2
0
        public void Repo_AuthActivity_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudiences();

            var results = UoW.AuthActivity.Get();

            results.Should().BeAssignableTo <IEnumerable <tbl_AuthActivity> >();
            results.Count().Should().Be(UoW.AuthActivity.Count());
        }
Beispiel #3
0
        public void Repo_AuthActivity_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudiences();

            var activity = UoW.AuthActivity.Get(QueryExpressionFactory.GetQueryExpression <tbl_AuthActivity>().ToLambda())
                           .First();

            UoW.AuthActivity.Delete(activity);
            UoW.Commit();
        }
Beispiel #4
0
        public void Repo_Audiences_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudiences();

            var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>()
                                             .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda())
                           .Single();

            audience.Name += "(Updated)";

            var result = UoW.Audiences.Update(audience);

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_Audience>();
        }
Beispiel #5
0
        public void Repo_AuthActivity_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudiences();

            var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>()
                                             .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda())
                           .Single();

            var result = UoW.AuthActivity.Create(
                Mapper.Map <tbl_AuthActivity>(new AuthActivityV1()
            {
                AudienceId   = audience.Id,
                LoginType    = GrantFlowType.ClientCredentialV2.ToString(),
                LoginOutcome = GrantFlowResultType.Success.ToString(),
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_AuthActivity>();
        }
Beispiel #6
0
        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>();
        }