コード例 #1
0
 public void Initialize()
 {
     _batchbllMock = new Mock <IBatchBll>();
     _loggerMock   = new Mock <ILog>();
     objController = new BatchController(_batchbllMock.Object, _loggerMock.Object);
     listBatches   = new List <BatchModel>()
     {
         new BatchModel()
         {
             BatchId = 1, Name = "US", Quantity = 10, Variety = "Rasberry"
         },
         new BatchModel()
         {
             BatchId = 2, Name = "US", Quantity = 10, Variety = "Rasberry2"
         },
         new BatchModel()
         {
             BatchId = 3, Name = "US", Quantity = 10, Variety = "Rasberry3"
         }
     };
 }
コード例 #2
0
        public void CreateBatchTest()
        {
            BatchDTO batch   = createBatchDTO();
            UserDTO  userDTO = createUserDTO();
            Guid     token   = Guid.NewGuid();

            var mockBatchService = new Mock <BatchService>();

            mockBatchService.Setup(b => b.CreateBatch(batch)).Verifiable();
            var mockUserService = new Mock <UserService>();

            mockUserService.Setup(us => us.GetUserLoggedIn(token)).Returns(userDTO);

            BatchController batchController = new BatchController(mockBatchService.Object, mockUserService.Object);

            batchController.Request = createBatchControllerRequest();
            this.addTokenHeaderToRequest(batchController.Request, token);

            ResponseMessageResult response = (ResponseMessageResult)batchController.Post(batch);

            Assert.AreEqual(HttpStatusCode.OK, response.Response.StatusCode);
        }
コード例 #3
0
        private void save_bt_Click(object sender, EventArgs e)
        {
            try
            {
                BatchController   batch         = new BatchController();
                StudentController stuentcontrol = new StudentController();


                if (batch.saveBatch(batch_txt.Text, term_com.SelectedItem.ToString()))
                {
                    stuentcontrol.saveStudent(frm_st_id_txt.Text, to_st_id_txt.Text, batch_txt.Text);
                    MessageBox.Show("saved successfully");
                }
                else
                {
                    MessageBox.Show("Don't save try again");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
 public void CleanUp()
 {
     _batchController.Dispose(); // assumes Disposable is implemented
     _batchController = null;
     //put other cleanup code here
 }
コード例 #5
0
 public void Setup()
 {
     _logger          = Mock.Of <ILogger <BatchController> >();
     _service         = new BatchDataMock();
     _batchController = new BatchController(_service, _logger);
 }
コード例 #6
0
ファイル: BatchTests.cs プロジェクト: priestd09/extems
 public static BatchController Fixture()
 {
     BatchController controller = new BatchController(new BatchRepository(), "", new LoginView());
     return controller;
 }
コード例 #7
0
ファイル: BatchTests.cs プロジェクト: umerlone/extems
        public static BatchController Fixture()
        {
            BatchController controller = new BatchController(new BatchRepository(), "", new LoginView());

            return(controller);
        }
コード例 #8
0
        private SpecificationEngine buildBatchedEngine(string tracingStyle)
        {
            IBatchObserver batchObserver = new BatchObserver();
            IExecutionObserver executionObserver = new NulloObserver();

            if ("TeamCity" == tracingStyle)
            {
                batchObserver = new TeamCityBatchObserver(batchObserver);
                executionObserver = new TeamCityExecutionObserver();
            }

            var executionMode = new BatchExecutionMode(batchObserver);
            var runner = new SpecRunner(executionMode, _system, _specExpiration);

            var engine = new SpecificationEngine(
                _system, runner, executionObserver);

            _controller = new BatchController(engine, batchObserver);

            _services.Add(engine);

            EventAggregator.Messaging.AddListener(_controller);

            return engine;
        }
コード例 #9
0
ファイル: BatchController-Test.cs プロジェクト: alwalker/TTU
 public void TestAddBatchError()
 {
     BatchController.AddBatch(null);
 }
コード例 #10
0
 public void Dispose()
 {
     controller = null;
 }