public void CreatedReceivedPurchaseOrderWithAnEmptySetOfReceivedBatches()
        {
            int           expectedCount = 0;
            ReceivedBatch received      = helper.GetUniqueBatch1();

            ReceivedPurchaseOrder receivedPO = new ReceivedPurchaseOrder(
                received.PONumber,
                received.ActivityDate,
                received.ReceivingOperator
                );

            Assert.AreEqual(expectedCount, receivedPO.ReceivedBatches.Count);
        }
Exemplo n.º 2
0
        public void CommandCanNotExecuteIfOperatorBelongsToReceivedBatch()
        {
            ReceivedBatchTestHelper helper = new ReceivedBatchTestHelper(operatorSource);

            receivedBatchSource.SaveReceivedBatch(helper.GetUniqueBatch1());
            viewModel.SelectedBatchOperatorFromListBoxIndex = 0;

            Assert.False(command.CanExecute(null));
        }
Exemplo n.º 3
0
        public void CommandCanNotExecuteIfOperatorBelongsToImplementedBatch()
        {
            ReceivedBatchTestHelper helper               = new ReceivedBatchTestHelper(operatorSource);
            BatchOperatorTestHelper operatorHelper       = new BatchOperatorTestHelper(operatorSource);
            ReceivedBatch           receivedBatch        = helper.GetUniqueBatch1();
            BatchOperator           implementingOperator = operatorHelper.GetJohnDoeOperator();

            receivedBatchSource.SaveReceivedBatch(receivedBatch);
            implementedBatchSource.AddBatchToImplementationLedger(receivedBatch.BatchNumber, DateTime.Now, operatorSource.FindBatchOperator(2));
            viewModel.SelectedBatchOperatorFromListBoxIndex = 1;

            Assert.False(command.CanExecute(null));
        }
        public void SavingReceivedBatchResultsInNewReceivedBatchAtLatestId()
        {
            int           targetCollectionId = 0;
            ReceivedBatch batch = helper.GetUniqueBatch1();

            receivedBatchSource.SaveReceivedBatch(batch);

            ReceivedBatch stored = receivedBatchSource.ReceivedBatchRepository[targetCollectionId];

            AssertSameReceivedBatchData(batch, stored);
        }
 void SetupBatchForReceiving()
 {
     receivedBatch = receivedBatchHelper.GetUniqueBatch1();
     batchOperator = batchOperatorHelper.GetJaneDoeOperator();
     date          = DateTime.Today;
 }