Initiate InventoyTypes from a xlxs
Arrival mostly working
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Controllers;
|
||||
using InventoryTraker.Web.Core;
|
||||
using InventoryTraker.Web.Models;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace InventoryTraker.Web.Tests.Models
|
||||
{
|
||||
[TestFixture]
|
||||
public class InventoryAddFormTests
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void StartUp()
|
||||
{
|
||||
HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies<Inventory>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Convert()
|
||||
{
|
||||
var form = new InventoryAddForm
|
||||
{
|
||||
AddedDate = DateTime.Today,
|
||||
ExpirationDate = DateTime.Today.AddDays(3),
|
||||
InventoryTypeId = "1",
|
||||
Memo = "My Memo",
|
||||
Quantity = 32
|
||||
};
|
||||
|
||||
var inventory = Mapper.Map<Inventory>(form);
|
||||
|
||||
Assert.That(inventory.AddedDate, Is.EqualTo(form.AddedDate));
|
||||
Assert.That(inventory.ExpirationDate, Is.EqualTo(form.ExpirationDate));
|
||||
Assert.That(inventory.Memo, Is.EqualTo(form.Memo));
|
||||
Assert.That(inventory.Quantity, Is.EqualTo(form.Quantity));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user