public void Refresh_NoStores_NoException() { var testSubject = new IssueLocationStoreAggregator(Enumerable.Empty <IIssueLocationStore>()); Action act = () => testSubject.Refresh(new [] { "test.cpp" }); act.Should().NotThrow(); }
public void Refresh_NullFilePaths_ArgumentNullException() { var testSubject = new IssueLocationStoreAggregator(Enumerable.Empty <IIssueLocationStore>()); Action act = () => testSubject.Refresh(null); act.Should().Throw <ArgumentNullException>().And.ParamName.Should().Be("affectedFilePaths"); }
public void Refresh_HasStores_AllStoresRefreshed() { var stores = new List <Mock <IIssueLocationStore> > { new Mock <IIssueLocationStore>(), new Mock <IIssueLocationStore>(), new Mock <IIssueLocationStore>() }; var affectedFilePaths = new[] { "a.cpp", "b.cpp" }; var testSubject = new IssueLocationStoreAggregator(stores.Select(x => x.Object)); testSubject.Refresh(affectedFilePaths); foreach (var store in stores) { store.Verify(x => x.Refresh(affectedFilePaths), Times.Once); } }