public void TestActionServiceOutOnlyDtosDatabaseOk()
        {
            //SETUP
            var options = SqliteInMemory.CreateOptions <TestDbContext>();

            using (var context = new TestDbContext(options))
            {
                context.Database.EnsureCreated();
                var bizInstance = new BizActionOutOnlyWriteDb(context);
                var runner      =
                    new ActionService <IBizActionOutOnlyWriteDb>(context, bizInstance, _wrappedConfig);

                //ATTEMPT
                var data = runner.RunBizAction <ServiceLayerBizOutDto>();

                //VERIFY
                bizInstance.HasErrors.ShouldBeFalse();
                context.LogEntries.Single().LogText.ShouldEqual("BizActionOutOnlyWriteDb");
            }
        }
示例#2
0
        public void TestActionServiceOutOnlyMappingDatabaseOk()
        {
            //SETUP
            var options = SqliteInMemory.CreateOptions <TestDbContext>();

            using (var context = new TestDbContext(options))
            {
                context.Database.EnsureCreated();

                var mapper      = SetupHelpers.CreateMapper <ServiceLayerBizOutDto>();
                var bizInstance = new BizActionOutOnlyWriteDb(context);
                var runner      = new ActionServiceOutOnly <IBizActionOutOnlyWriteDb, BizDataOut>(true, _noCachingConfig);

                //ATTEMPT
                var data = runner.RunBizActionDbAndInstance <ServiceLayerBizOutDto>(context, bizInstance, mapper);

                //VERIFY
                bizInstance.HasErrors.ShouldBeFalse();
                context.LogEntries.Single().LogText.ShouldEqual("BizActionOutOnlyWriteDb");
            }
        }