public void Test_CreateBusinessObject()
        {
            //---------------Set up test pack-------------------
            var factory = new BOFactory();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var businessObject = factory.CreateBusinessObject(typeof(FakeBO));
            //---------------Test Result -----------------------
            Assert.IsNotNull(businessObject);
            Assert.IsInstanceOf<FakeBO>(businessObject);
        }
        public void Test_CreateBusinessObjectGenericViaInterface()
        {
            //---------------Set up test pack-------------------
            IBOFactory factory = new BOFactory();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var businessObject = factory.CreateBusinessObject<FakeBO>();
            //---------------Test Result -----------------------
            Assert.IsNotNull(businessObject);
            Assert.IsInstanceOf<FakeBO>(businessObject);
        }
Пример #3
0
        public void Test_CreateBusinessObjectViaInterface()
        {
            //---------------Set up test pack-------------------
            IBOFactory factory = new BOFactory();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var businessObject = factory.CreateBusinessObject(typeof(FakeBO));

            //---------------Test Result -----------------------
            Assert.IsNotNull(businessObject);
            Assert.IsInstanceOf <FakeBO>(businessObject);
        }
Пример #4
0
        public void Test_CreateBusinessObjectGeneric()
        {
            //---------------Set up test pack-------------------
            var factory = new BOFactory();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var businessObject = factory.CreateBusinessObject <FakeBO>();

            //---------------Test Result -----------------------
            Assert.IsNotNull(businessObject);
            Assert.IsInstanceOf <FakeBO>(businessObject);
        }
Пример #5
0
        public void Test_CreateBusinessObject_WhenTypeNotIBO_ShouldRaiseError()
        {
            //---------------Set up test pack-------------------
            IBOFactory factory = new BOFactory();

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            try
            {
                factory.CreateBusinessObject(typeof(int));
                Assert.Fail("Expected to throw an HabaneroDeveloperException");
            }
            //---------------Test Result -----------------------
            catch (HabaneroDeveloperException ex)
            {
                StringAssert.Contains("The BOFactory.CreateBusinessObject was called with Type that does not implement IBusinessObject", ex.Message);
            }
        }
        public void Test_CreateBusinessObject_WhenTypeNotIBO_ShouldRaiseError()
        {
            //---------------Set up test pack-------------------
            IBOFactory factory = new BOFactory();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            try
            {
                factory.CreateBusinessObject(typeof(int));
                Assert.Fail("Expected to throw an HabaneroDeveloperException");
            }
            //---------------Test Result -----------------------
            catch (HabaneroDeveloperException ex)
            {
                StringAssert.Contains("The BOFactory.CreateBusinessObject was called with Type that does not implement IBusinessObject", ex.Message);
            }
        }