public void DeleteHop_Failed()
        {
            string       given = "ABCDEF123";
            DALException ex    = Assert.Throws <DALException>(() => _dal.Delete(given));

            Assert.AreEqual("System.InvalidOperationException Exception in Delete", ex.Message);
        }
        public void CreateWebhook_SameId_Failed()
        {
            Webhook webhook = new Webhook();
            long    id      = _dal.Create(webhook);

            DALException exc = Assert.Throws <DALException>(() => _dal.Create(webhook));

            StringAssert.StartsWith("System.ArgumentException Exception in Create", exc.Message);
        }
Example #3
0
        public void CreateParcels_SameId_Failed()
        {
            Parcel parcel = new Parcel();

            int id2 = _dal.Create(parcel);

            DALException exc = Assert.Throws <DALException>(() => _dal.Create(parcel));

            StringAssert.StartsWith("System.ArgumentException Exception in Create", exc.Message);
        }
        public void CreateHop_SqlException()
        {
            Hop hop = new Hop()
            {
                Code = "ABCDEF123"
            };
            string       code = _dal.Create(hop);
            DALException ex   = Assert.Throws <DALException>(() => _dal.Create(hop));

            StringAssert.StartsWith("An item with the same key has already been added", ex.InnerException.Message);
        }