Inventory and Type reports
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace InventoryTraker.Web.Tests
|
||||
{
|
||||
[SetUpFixture]
|
||||
public class Setup
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void S()
|
||||
{
|
||||
HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies<Inventory>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,8 @@
|
||||
<Compile Include="App_Start\AutoMapperConfig.cs" />
|
||||
<Compile Include="Models\InventoryAddForm.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="App_Start\Setup.cs" />
|
||||
<Compile Include="Utilities\InventoryReportWriterTests.cs" />
|
||||
<Compile Include="Utilities\DistributionReportWriterTests.cs" />
|
||||
<Compile Include="Utilities\MovementReportWriterTests.cs" />
|
||||
<Compile Include="Utilities\InventoryTypeParserTests.cs" />
|
||||
|
||||
@@ -11,12 +11,6 @@ namespace InventoryTraker.Web.Tests.Utilities
|
||||
[TestFixture]
|
||||
public class DistributionReportWriterTests
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void StartUp()
|
||||
{
|
||||
HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies<Inventory>();
|
||||
}
|
||||
|
||||
private readonly DistributionReport[] _distributionReports =
|
||||
{
|
||||
new DistributionReport
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
using InventoryTraker.Web.Models;
|
||||
using InventoryTraker.Web.Utilities;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace InventoryTraker.Web.Tests.Utilities
|
||||
{
|
||||
[TestFixture]
|
||||
public class InventoryReportWriterTests
|
||||
{
|
||||
private readonly InventoryViewModel[] _inventory =
|
||||
{
|
||||
new InventoryViewModel
|
||||
{
|
||||
|
||||
Name = "Beans",
|
||||
ContainerType = "#300 cans",
|
||||
UnitsPerCase = 24,
|
||||
AddedDate = new DateTime(2015,3,1),
|
||||
ExpirationDate = new DateTime(2017,4,1),
|
||||
Quantity = 20,
|
||||
Memo = "my memo",
|
||||
PricePerCase = 12.12M,
|
||||
WeightPerCase = 20.1,
|
||||
}
|
||||
};
|
||||
|
||||
[Test, Explicit]
|
||||
public void Write()
|
||||
{
|
||||
using
|
||||
(var outputFile
|
||||
= new StreamWriter(Path.Combine(@"c:\temp", "InventoryReport.xlsx")))
|
||||
{
|
||||
var writer = new InventoryReportWriter();
|
||||
writer.WriteStream(_inventory, outputFile.BaseStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,6 @@ namespace InventoryTraker.Web.Tests.Utilities
|
||||
[TestFixture]
|
||||
public class MovementReportWriterTests
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void StartUp()
|
||||
{
|
||||
HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies<Inventory>();
|
||||
}
|
||||
|
||||
private readonly MovementReport _movementReport
|
||||
= new MovementReport
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user