Ejemplo n.º 1
0
        public async Task GivenKP17Data_WhenGenerateReport_ThenBataillonIsTheSameAsCompany()
        {
            const string company = "Riststabskp 17";

            GivenCompany(company);
            GivenDuro();

            _materialDispositionContext.GivenInventoryItems(new MaterialInventoryItem
            {
                SapNr        = DuroSapNr,
                Company      = company,
                Distribution = new List <MaterialAllocation>
                {
                    MaterialAllocation.For("Langnau i.E.", 12, 10, 2)
                }
            });

            var sut = new BataillonReporter(_dispositionContext, _materialDispositionContext, _servantDispositionContext);
            await sut.GenerateDispositionReport(new DateTime(2018, 10, 31, 0, 0, 0, DateTimeKind.Utc));

            var materialReport = await GetMaterialReport();

            var reportItem = materialReport.MaterialReportItems.Single(item => item.Material.SapNr == DuroSapNr);

            reportItem.Damaged.Should().Be(2);
            reportItem.Used.Should().Be(10);
            reportItem.Stock.Should().Be(12);
            reportItem.PerCompany.Should().HaveCount(1);
        }
Ejemplo n.º 2
0
        private async Task <string> GivenCompanyWithKpFront()
        {
            var companyId = await GivenCompany("KP Rw", "KP Front", "Somewhere");

            _materialDispositionContext.GivenInventoryItems(new MaterialInventoryItem
            {
                Company      = CompanyName,
                SapNr        = "256.165",
                Distribution = new List <MaterialAllocation>
                {
                    MaterialAllocation.For("Somewhere", 5),
                    MaterialAllocation.For("KP Rw", 0),
                    MaterialAllocation.For("KP Front", 0),
                }
            });
            return(companyId);
        }
Ejemplo n.º 3
0
 private void GivenPuchIventory()
 {
     _materialDispositionContext.GivenInventoryItems(new MaterialInventoryItem
     {
         SapNr        = PuchSapNr,
         Company      = CompanyName,
         Distribution = new List <MaterialAllocation>
         {
             MaterialAllocation.For("Bern", 12, 10, 2)
         }
     });
 }
 private void GivenPuchInventory(string location, int stock = 0, int damaged = 1, int used = 0)
 {
     _materialDispositionContext.GivenInventoryItems(new MaterialInventoryItem
     {
         Company      = CompanyName,
         SapNr        = PuchSapNr,
         Distribution = new List <MaterialAllocation>
         {
             new MaterialAllocation
             {
                 Stock    = stock,
                 Damaged  = damaged,
                 Location = location,
                 Used     = used
             }
         }
     });
 }