public void TestMoveItemInListsShouldThrowOutOfRange() { IList<Item> items = new List<Item>(); IList<Item> items2 = new List<Item>(); LayersBLMock mock = new LayersBLMock(); mock.MoveItemInListsForTests(items, items2, 123); }
public void TestMoveItemInListsShouldSuccess() { IList<Item> items = new List<Item>(); IList<Item> items2 = new List<Item>(); items.Add(new Item() { ItemName = "2", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") }); LayersBLMock mock = new LayersBLMock(); mock.MoveItemInListsForTests(items, items2, 0); Assert.AreEqual(0, items.Count); Assert.AreEqual(1, items2.Count); Item iResult = items2[0]; Assert.AreEqual("2", iResult.ItemName); Assert.AreEqual(1, iResult.ItemAmount); DateTime dt = DateTime.Parse("11.11.2011"); Assert.AreEqual(dt, iResult.CreationDate); }
public void TestMoveItemShouldMoveToLeft() { LayersBLMock mock = new LayersBLMock(); Item itemToMove = new Item() { ItemName = "2", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") }; mock.List2.Add(itemToMove); mock.MoveItem(itemToMove); Assert.AreEqual(4, mock.List1.Count); Assert.AreEqual(0, mock.List2.Count); Item iResult = mock.List1[3]; Assert.AreEqual("2", iResult.ItemName); Assert.AreEqual(1, iResult.ItemAmount); DateTime dt = DateTime.Parse("11.11.2011"); Assert.AreEqual(dt, iResult.CreationDate); }
public void TestsIsItemInListsShouldBeTrue() { LayersBLMock mock = new LayersBLMock(); IList<Item> items = new List<Item>(); items.Add(new Item() { ItemName = "1", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") }); Item itemToPass = new Item() { ItemName = "1", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") }; Boolean itemInList = mock.IsItemInLeftListForTests(itemToPass, items); Assert.IsTrue(itemInList); }
public void TestMoveItemShouldThrowItemNotFound() { LayersBLMock mock = new LayersBLMock(); Item itemToMove = new Item() { ItemName = "2", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") }; mock.MoveItem(itemToMove); }