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

            data.Destroy();
            data.CreateMOTDs();

            var results = UoW.MOTDs.Get();

            results.Should().BeAssignableTo <IEnumerable <uvw_MOTD> >();
            results.Count().Should().Be(UoW.MOTDs.Count());
        }
예제 #2
0
        public void Repo_MOTDs_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateMOTDs();

            var MOTD = UoW.MOTDs.Get(QueryExpressionFactory.GetQueryExpression <uvw_MOTD>()
                                     .Where(x => x.Author == TestDefaultConstants.MOTDAuthor).ToLambda())
                       .First();

            UoW.MOTDs.Delete(MOTD);
            UoW.Commit();
        }
예제 #3
0
        public void Repo_MOTDs_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateMOTDs();

            var result = UoW.MOTDs.Create(
                Mapper.Map <uvw_MOTD>(new MOTDTssV1
            {
                author = TestDefaultConstants.MOTDAuthor,
                quote  = "Quote-" + Base64.CreateString(4),
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <uvw_MOTD>();
        }
예제 #4
0
        public void Repo_MOTDs_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateMOTDs();

            var MOTD = UoW.MOTDs.Get(QueryExpressionFactory.GetQueryExpression <uvw_MOTD>()
                                     .Where(x => x.Author == TestDefaultConstants.MOTDAuthor).ToLambda())
                       .First();

            MOTD.Quote += "(Updated)";

            var result = UoW.MOTDs.Update(MOTD);

            UoW.Commit();

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