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); }
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); }