public void Throws_ArgumentNullException_FromCalling_AddConverter() { // arrange var sut = new HateoasSerializer(); const string parameterName = "converter"; // act Action actual = () => sut.AddConverter <Guid>(null); Assert.Throws <ArgumentNullException>(parameterName, actual); }
public void AddConverter_WithValidJsonConverter_AddsNewConverter <T>(JsonConverter <T> converter) { // arrange var sut = new HateoasSerializer(); sut.ResetConverters(); // act sut.AddConverter(converter); // assert Assert.Contains(sut.Settings.Converters, x => x.GetType() == converter.GetType()); Assert.Collection(sut.Settings.Converters, x => x.CanConvert(typeof(T))); }