예제 #1
0
        public void Set_MapContainsConversion_Throws()
        {
            var underTest = new ConversionMap <int>();

            underTest.Set(new Mock <IConversion <int, string> >().Object);

            var ex = Assert.Throws <ArgumentException>(() =>
            {
                underTest.Set(new Mock <IConversion <int, string> >().Object);
            });

            Assert.Equal("conversion", ex.ParamName);
        }
예제 #2
0
        public void Set_MapDoesNotContainConversion_Returns()
        {
            var conversion = new Mock <IConversion <int, string> >();
            var underTest  = new ConversionMap <int>();

            underTest.Set(conversion.Object);
        }
예제 #3
0
        public void Set_NullConversion_Throws()
        {
            var underTest = new ConversionMap <int>();

            var ex = Assert.Throws <ArgumentNullException>(() => underTest.Set <string>(null));

            Assert.Equal("conversion", ex.ParamName);
        }
예제 #4
0
        public void Get_MapContainsConversion_ReturnsConversion()
        {
            var expected  = new Mock <IConversion <int, string> >().Object;
            var underTest = new ConversionMap <int>();

            underTest.Set(expected);

            var actual = underTest.Get <string>().Value;

            Assert.Equal(expected, actual);
        }