Пример #1
0
        public void Update_Multiple_Given_Bag_Without_Id_Throws_ArgumentException()
        {
            BagDML            bagdml   = new BagDML();
            ArgumentException expected = null;
            List <Bag>        bags     = new List <Bag> {
                new Bag(0),
                new Bag(0)
            };

            try
            {
                bagdml.Update_Multiple(bags);
            }
            catch (ArgumentException e)
            {
                expected = e;
            }

            Assert.IsNotNull(expected);
        }
Пример #2
0
        public void Update_Multiple_Updates_Row_Matching_Id()
        {
            BagDML bagdml = new BagDML();

            ClearDatabase();
            InsertTestData();
            List <Bag> expected = new List <Bag> {
                new Bag(1, 2, DateTime.Now),
                new Bag(2, 2, DateTime.Now),
                new Bag(3, 1, DateTime.Now)
            };

            bagdml.Update_Multiple(expected);

            List <Bag> actual = getMultipleBags();

            for (int i = 0; i < actual.Count; i++)
            {
                Assert.AreEqual(expected[i], actual[i]);
            }
        }