public void CheckIfUpconvertersExistOrThrow_WithThreEventsAndAllUpconverters_ShouldNotThrow() { var arrangements = new Arrangements(); arrangements.AddUpconverter <Event_V1, Event_V2>(); arrangements.AddUpconverter <Event_V2, Event_V3>(); var exception = Record.Exception(() => UpconverterExistsForEventsValidator.CheckIfUpconvertersExistOrThrow(arrangements.EventTypes, t => t == typeof(Event_V1), arrangements.Converters)); exception.Should().BeNull(); }
public void CheckIfUpconvertersExistOrThrow_WithThreEventsWithOnlyOneUpconverter_ShouldThrow() { var arrangements = new Arrangements(); arrangements.AddUpconverter <Event_V1, Event_V2>(); var exception = Record.Exception(() => UpconverterExistsForEventsValidator.CheckIfUpconvertersExistOrThrow(arrangements.EventTypes, t => t == typeof(Event_V1), arrangements.Converters)); exception.Should().NotBeNull(); exception.Should().BeOfType <MissingUpconverterException>(); }