Inventory and Type reports
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user