private SubtitleParser CreateParser( ISubtitleIdParser idParser, ISubtitleTimestampsParser timestampsParser) { return(new SubtitleParser( idParser, timestampsParser)); }
public void Constructor_NullSubtitleIdParser_Throws() { ISubtitleIdParser nullSubtitleIdParser = null; var stubTimestampsParser = Substitute.For <ISubtitleTimestampsParser>(); Assert.Throws <ArgumentNullException>( () => new SubtitleParser( nullSubtitleIdParser, stubTimestampsParser)); }
public SubtitleParser( ISubtitleIdParser subtitleIdParser, ISubtitleTimestampsParser timestampsParser) { if (subtitleIdParser == null) { throw new ArgumentNullException(nameof(subtitleIdParser)); } if (timestampsParser == null) { throw new ArgumentNullException(nameof(timestampsParser)); } this.subtitleIdParser = subtitleIdParser; this.timestampsParser = timestampsParser; }
private SubtitleParser CreateParser(ISubtitleIdParser idParser) { return(CreateParser( idParser, Substitute.For <ISubtitleTimestampsParser>())); }