Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }