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

            data.Destroy();
            data.CreateAudienceRefreshes();

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

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

            var result = UoW.Refreshes.Create(
                Mapper.Map <E_Refresh>(new RefreshV1()
            {
                IssuerId     = issuer.Id,
                AudienceId   = audience.Id,
                RefreshType  = ConsumerType.User.ToString(),
                RefreshValue = Base64.CreateString(8),
                ValidFromUtc = DateTime.UtcNow,
                ValidToUtc   = DateTime.UtcNow.AddSeconds(60),
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <E_Refresh>();
        }
Ejemplo n.º 2
0
        public void Repo_Refreshes_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudienceRefreshes();

            var results = UoW.Refreshes.Get();

            results.Should().BeAssignableTo <IEnumerable <E_Refresh> >();
            results.Count().Should().Be(UoW.Refreshes.Count());
        }
Ejemplo n.º 3
0
        public void Repo_Refreshes_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateAudienceRefreshes();

            var activity = UoW.Refreshes.Get().First();

            UoW.Refreshes.Delete(activity);
            UoW.Commit();
        }