public void IsNew_GivenIdNotSet_ShouldReturnTrue()
        {
            //---------------Set up test pack-------------------
            var entityBaseImpl = new EntityBaseImpl();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var isNew = entityBaseImpl.IsNew();
            //---------------Test Result -----------------------
            Assert.IsTrue(isNew);
        }
Beispiel #2
0
        public void IsNew_GivenIdNotSet_ShouldReturnTrue()
        {
            //---------------Set up test pack-------------------
            var entityBaseImpl = new EntityBaseImpl();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var isNew = entityBaseImpl.IsNew();

            //---------------Test Result -----------------------
            Assert.IsTrue(isNew);
        }
        public void IsNew_GivenIdIsLessThan0_ShouldThrow()
        {
            //---------------Set up test pack-------------------
            var entityBaseImpl = new EntityBaseImpl();
            entityBaseImpl.Id = -11;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var ex = Assert.Throws<InvalidOperationException>(() => entityBaseImpl.IsNew());
            //---------------Test Result -----------------------
            Assert.AreEqual("Id cannot be less than 0", ex.Message);
        }
Beispiel #4
0
        public void IsNew_GivenIdIsLessThan0_ShouldThrow()
        {
            //---------------Set up test pack-------------------
            var entityBaseImpl = new EntityBaseImpl();

            entityBaseImpl.Id = -11;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var ex = Assert.Throws <InvalidOperationException>(() => entityBaseImpl.IsNew());

            //---------------Test Result -----------------------
            Assert.AreEqual("Id cannot be less than 0", ex.Message);
        }