public void NonHotelWorkItemInputShouldThrowTest()
        {
            IWorkItemCommandFactory commandFactory = new HotelWorkItemCommandFactory();
            var command = commandFactory.BuildCommand(new TestWorkItem());

            Assert.Fail("Build command with non hotelworkitem input did not throw.");
        }
        public void NullWorkItemShouldThrowTest()
        {
            IWorkItemCommandFactory commandFactory = new HotelWorkItemCommandFactory();
            var command = commandFactory.BuildCommand(null);

            Assert.Fail("Build command with null input did not throw.");
        }
        public void HotelWorkItemInputShouldBuildOnDataTypeAndChangeTypeTest()
        {
            var dataType = Unique.NewString;
            var workItem = new HotelWorkItem()
            {
                Schema = dataType, ChangeType = ChangeType.Updated
            };
            var command = new Mock <IWorkItemCommand>().Object;

            try
            {
                var key = string.Format("{0}.{1}", dataType, "Updated");
                ObjectBuilder.RegisterInstance <IWorkItemCommand>(command, key);
                IWorkItemCommandFactory commandFactory = new HotelWorkItemCommandFactory();
                var cmd = commandFactory.BuildCommand(workItem);
                Assert.IsTrue(cmd == command, "Incorrect command built by the factory for the given workitem.");
            }
            finally
            {
                ObjectBuilder.Reset();
            }
        }