Example #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 <uvw_Audience> >();
            results.Count().Should().Be(UoW.Audiences.Count());
        }
Example #2
0
        public void Repo_Audiences_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

            UoW.Audiences.Delete(audience);
            UoW.Commit();
        }
Example #3
0
        public void Repo_Audiences_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

            audience.Name += "(Updated)";

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

            UoW.Commit();

            result.Should().BeAssignableTo <uvw_Audience>();
        }
Example #4
0
        public void Repo_Audiences_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

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

            UoW.Commit();

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