示例#1
0
        public void Repo_EmailQueue_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateEmails();

            var user = UoW.Users.Get(QueryExpressionFactory.GetQueryExpression <uvw_User>()
                                     .Where(x => x.UserName == TestDefaultConstants.UserName).ToLambda())
                       .First();

            var result = UoW.EmailQueue.Create(
                Mapper.Map <uvw_EmailQueue>(new EmailV1()
            {
                FromEmail = user.EmailAddress,
                ToEmail   = user.EmailAddress,
                Subject   = "Subject-" + Base64.CreateString(4),
                Body      = "Body-" + Base64.CreateString(32),
                SendAtUtc = DateTime.UtcNow,
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <uvw_EmailQueue>();
        }
示例#2
0
        public void Repo_EmailQueue_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateEmails();

            var results = UoW.EmailQueue.Get();

            results.Should().BeAssignableTo <IEnumerable <uvw_EmailQueue> >();
            results.Count().Should().Be(UoW.EmailQueue.Count());
        }
示例#3
0
        public void Repo_EmailQueue_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateEmails();

            var email = UoW.EmailQueue.Get(QueryExpressionFactory.GetQueryExpression <uvw_EmailQueue>().ToLambda())
                        .First();

            UoW.EmailQueue.Delete(email);
            UoW.Commit();
        }
示例#4
0
        public void Repo_EmailQueue_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateEmails();

            var email = UoW.EmailQueue.Get(QueryExpressionFactory.GetQueryExpression <uvw_EmailQueue>().ToLambda())
                        .First();

            email.Subject += "(Updated)";

            var result = UoW.EmailQueue.Update(email);

            UoW.Commit();

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