public void CreateReceivedPurchaseOrderFromExistingData()
        {
            ReceivedBatch received              = helper.GetBatchWithSpecificDate(new DateTime(2019, 7, 4));
            int           expectedPONumber      = received.PONumber;
            DateTime      expectedActivityDate  = received.ActivityDate;
            BatchOperator expectedBatchOperator = received.ReceivingOperator;
            int           expectedCount         = 3;
            string        expectedDateDisplay   = "July 4, 2019";

            ObservableCollection <ReceivedBatch> receivedBatches = new ObservableCollection <ReceivedBatch>()
            {
                received, received, received
            };

            ReceivedPurchaseOrder receivedPO = new ReceivedPurchaseOrder(
                expectedPONumber,
                expectedActivityDate,
                expectedBatchOperator,
                receivedBatches
                );

            Assert.AreEqual(expectedPONumber, receivedPO.PONumber);
            Assert.AreEqual(expectedActivityDate, receivedPO.ActivityDate);
            Assert.AreEqual(expectedDateDisplay, receivedPO.DisplayDate);
            Assert.AreSame(expectedBatchOperator, receivedPO.ReceivingOperator);
            Assert.AreEqual(expectedCount, receivedPO.ReceivedBatches.Count);
        }
Exemplo n.º 2
0
        string SetupValidDataSourceStateForProperPopulationOfHistoryGridsAndReturnTargetBatchNumber()
        {
            ReceivedBatch receivedBatch = receivedBatchHelper.GetBatchWithSpecificDate(DateTime.Today);

            ReceiveFiveBatchesOfTheSameBatchIntoInventory(receivedBatch);
            ImplementAllButOneBatch(receivedBatch.BatchNumber);

            return(receivedBatch.BatchNumber);
        }
        public void FindingReceivedBatchesByReceivingDateExcludesBatchesThatDoNotMeetCriteria()
        {
            int      expectedCount = 2;
            DateTime dateCriteria  = DateTime.Now.AddDays(1);

            receivedBatchSource.SaveReceivedBatch(helper.GetUniqueBatch1());
            receivedBatchSource.SaveReceivedBatch(helper.GetBatchWithSpecificDate(dateCriteria));
            receivedBatchSource.SaveReceivedBatch(helper.GetBatchWithSpecificDate(dateCriteria));

            receivedBatchSource.FindReceivedBatchesByDate(dateCriteria);

            Assert.AreEqual(expectedCount, receivedBatchSource.ReceivedBatchRepository.Count);
        }