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); }
public void Set_MapDoesNotContainConversion_Returns() { var conversion = new Mock <IConversion <int, string> >(); var underTest = new ConversionMap <int>(); underTest.Set(conversion.Object); }
public void Set_NullConversion_Throws() { var underTest = new ConversionMap <int>(); var ex = Assert.Throws <ArgumentNullException>(() => underTest.Set <string>(null)); Assert.Equal("conversion", ex.ParamName); }
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); }