public void IsFileValid_Valid_CheckSuccess() { // arrange var fileAnalyzerStub = new FileAnalyzerStub(true, true); var persistanceService = new PersistanceService(fileAnalyzerStub); // act var result = persistanceService.IsFileValid(VALID_PATH); // assert Assert.That(result, Is.True); }
public void IsFileValid_NotAuthorized_CheckFailed() { // arrange var fileAnalyzerStub = new FileAnalyzerStub(true, false); var persistanceService = new PersistanceService(fileAnalyzerStub); // act var result = persistanceService.IsFileValid(VALID_PATH); // assert Assert.That(result, Is.False); }
public void IsFileValid_Valid_FileAnalyzerCalled() { // arrange var fileAnalyzerMock = new FileAnalyzerMock(); var persistanceService = new PersistanceService(fileAnalyzerMock); // act persistanceService.IsFileValid(VALID_PATH); // assert Assert.That(fileAnalyzerMock.CheckFormatCalled, Is.True); Assert.That(fileAnalyzerMock.CheckExistsCalled, Is.True); }