public void FindSourceControlPluginShouldReturnNullWhenPluginWasNotFound() { // Arrange var sut = new PluginRepository(System.Array.Empty <IBuildPlugin>(), System.Array.Empty <ISourceControlPlugin>(), System.Array.Empty <INotificationProcessor>(), Substitute.For <ITypeMatcher>()); // Act var actual = sut.FindSourceControlPlugin("non.existing"); // Assert Assert.Null(actual); }
public void FindSourceControlPluginShouldFindPluginWhenExisting() { // Arrange var sourceControlPlugins = new[] { Substitute.For <ISourceControlPlugin>() }; var typeMatcher = Substitute.For <ITypeMatcher>(); typeMatcher.MatchesType(sourceControlPlugins[0].GetType(), "typeName").Returns(true); var sut = new PluginRepository(System.Array.Empty <IBuildPlugin>(), sourceControlPlugins, System.Array.Empty <INotificationProcessor>(), typeMatcher); // Act var actual = sut.FindSourceControlPlugin("typeName"); // Assert Assert.NotNull(actual); }