Пример #1
0
        public void Repo_TextQueue_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateTexts();

            var results = UoW.TextQueue.Get();

            results.Should().BeAssignableTo <IEnumerable <tbl_TextQueue> >();
            results.Count().Should().Be(UoW.TextQueue.Count());
        }
Пример #2
0
        public void Repo_TextQueue_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateTexts();

            var text = UoW.TextQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_TextQueue>().ToLambda())
                       .First();

            UoW.TextQueue.Delete(text);
            UoW.Commit();
        }
Пример #3
0
        public void Repo_TextQueue_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateTexts();

            var text = UoW.TextQueue.Get(QueryExpressionFactory.GetQueryExpression <tbl_TextQueue>().ToLambda())
                       .First();

            text.Body += "(Updated)";

            var result = UoW.TextQueue.Update(text);

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_TextQueue>();
        }
Пример #4
0
        public void Repo_TextQueue_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateTexts();

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

            var result = UoW.TextQueue.Create(
                Mapper.Map <tbl_TextQueue>(new TextV1()
            {
                FromPhoneNumber = TestDefaultConstants.UserPhoneNumber,
                ToPhoneNumber   = TestDefaultConstants.UserPhoneNumber,
                Body            = "Body-" + Base64.CreateString(32),
                SendAtUtc       = DateTime.UtcNow,
            }));

            UoW.Commit();

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