Ejemplo n.º 1
0
        public void Repo_Audiences_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

            var results = UoW.Audiences.Get();

            results.Should().BeAssignableTo <IEnumerable <E_Audience> >();
            results.Count().Should().Be(UoW.Audiences.Count());
        }
Ejemplo n.º 2
0
        public void Repo_AuthActivity_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

            UoW.AuthActivity.Delete(activity);
            UoW.Commit();
        }
Ejemplo n.º 3
0
        public void Repo_Audiences_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

            UoW.Audiences.Delete(audience);
            UoW.Commit();
        }
Ejemplo n.º 4
0
        public void Repo_Audiences_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

            audience.Name += "(Updated)";

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

            UoW.Commit();

            result.Should().BeAssignableTo <E_Audience>();
        }
Ejemplo n.º 5
0
        public void Repo_AuthActivity_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

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

            UoW.Commit();

            result.Should().BeAssignableTo <E_AuthActivity>();
        }
Ejemplo n.º 6
0
        public void Repo_Audiences_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

            var issuer = UoW.Issuers.Get(QueryExpressionFactory.GetQueryExpression <E_Issuer>()
                                         .Where(x => x.Name == TestDefaultConstants.IssuerName).ToLambda())
                         .Single();

            var result = UoW.Audiences.Create(
                Mapper.Map <E_Audience>(new AudienceV1()
            {
                IssuerId    = issuer.Id,
                Name        = TestDefaultConstants.AudienceName,
                IsLockedOut = false,
                IsDeletable = true,
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <E_Audience>();
        }