Ejemplo n.º 1
0
 public void TestMoveItemInListsShouldThrowOutOfRange()
 {
     IList<Item> items = new List<Item>();
     IList<Item> items2 = new List<Item>();
     LayersBLMock mock = new LayersBLMock();
     mock.MoveItemInListsForTests(items, items2, 123);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void TestMoveItemShouldThrowItemNotFound()
 {
     LayersBLMock mock = new LayersBLMock();
     Item itemToMove = new Item() { ItemName = "2", ItemAmount = 1, CreationDate = DateTime.Parse("11.11.2011") };
     mock.MoveItem(itemToMove);
 }