public void ShouldBeAbleToBuild()
            {
                var instruction = new Mock<IProcessingInstruction>();
                var instructionInstance = instruction.Object;

                var factoryProvider = new TestProcessingInstructionProvider();
                factoryProvider.Factories.Add(instructionInstance.GetType().FullName, instructionInstance);
                var result = factoryProvider.Retrieve(instructionInstance.GetType().FullName);

                Assert.Same(instructionInstance, result);
            }
            public void ShouldBeAbleToRegister()
            {
                var instruction = new Mock<IProcessingInstruction>();
                var instructionInstance = instruction.Object;

                var factoryProvider = new TestProcessingInstructionProvider();
                factoryProvider.Register(instruction.Object);

                Assert.Contains(instructionInstance.GetType().FullName, factoryProvider.Factories.Keys);

                instruction.VerifyAll();
            }
 public void SHouldThrowExceptionWhenFactoryNotFound()
 {
     var factoryProvider = new TestProcessingInstructionProvider();
     Assert.Throws<KeyNotFoundException>(() => factoryProvider.Retrieve("Test"));
 }