コード例 #1
0
        public void RegisterBarcodeFailTest(string appName)
        {
            RegisterBarcodeApplication app = (RegisterBarcodeApplication)FactoryConsoleApplication.CreateConsoleApplicationObject(appName);
            OptionSet opt = app.CreateOptionSet();

            opt.Parse(args);

            INoSqlContext ctx = new Mock <INoSqlContext>().Object;

            app.SetNoSqlContext(ctx);

            //To cover test coverage
            app.GetLogger();

            app.Run();
            Assert.True(true);
        }
コード例 #2
0
        public void RegisterBarcodeSuccessTest(string appName, bool IsActivated)
        {
            RegisterBarcodeApplication app = (RegisterBarcodeApplication)FactoryConsoleApplication.CreateConsoleApplicationObject(appName);
            OptionSet opt = app.CreateOptionSet();

            opt.Parse(args);

            MockedNoSqlContext ctx = new MockedNoSqlContext();

            MBarcode barcode = new MBarcode();

            barcode.IsActivated = IsActivated;
            ctx.SetReturnObjectByKey(barcode);
            app.SetNoSqlContext(ctx);

            //To cover test coverage
            app.GetLogger();

            app.Run();
            Assert.True(true);
        }