예제 #1
0
		public void TestPipelineDataaIsNullThrowsException()
		{
			var registry = new MapperRegistry();
			registry.Add(new FakeMap());

			var map = registry.Get<ICommandMetadata, IInputModel>();
			Assert.NotNull(map);

			var step = new GetInputModelStep(registry);
			var data = step.Execute(null);
		}
예제 #2
0
        public void TestRegistry()
        {
            //Arrange
            var mockMap = new Mock<IMapper<int, string>>();
            mockMap.Setup(m => m.Source).Returns(typeof (int));
            mockMap.Setup(m => m.Destination).Returns(typeof (string));

            var registry = new MapperRegistry();

            registry.Add(mockMap.Object);

            var map = registry.Get<int, string>();
            Assert.NotNull(map);
        }
예제 #3
0
		public void TestPipelineDataContainsNullValue()
		{
			var registry = new MapperRegistry();
			registry.Add(new FakeMap());

			var map = registry.Get<ICommandMetadata, IInputModel>();
			Assert.NotNull(map);

			var data = new MapCommandPipelineData
			           	{
			           		CommandMetadata = null
			           	};

			var step = new GetInputModelStep(registry);
			data = step.Execute(data);
		}
예제 #4
0
		public void TestMetadataToInputModelStep()
		{
			var registry = new MapperRegistry();
			registry.Add(new FakeMap());

			var map = registry.Get<ICommandMetadata, IInputModel>();
			Assert.NotNull(map);

			var data = new MapCommandPipelineData
			           	{
			           		CommandMetadata = new Mock<ICommandMetadata>().Object
			           	};

			var step = new GetInputModelStep(registry);
			data = step.Execute(data);

			Assert.NotNull(data.InputModel);
		}