예제 #1
0
        public void Repo_Refreshes_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

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

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

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

            var result = UoW.Refreshes.Create(
                Mapper.Map <tbl_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 <tbl_Refresh>();
        }
예제 #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 <tbl_Refresh> >();
            results.Count().Should().Be(UoW.Refreshes.Count());
        }
예제 #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();
        }