示例#1
0
        public async void ScanFileAsync_GivenFileHasBeenRemoved_ScanResultShouldBeVirus()
        {
            A.CallTo(() => fileAccess.FileExists(FileName)).Returns(false);

            var result = await virusScanner.ScanFileAsync(A.Dummy <byte[]>(), A.Dummy <string>());

            Assert.Equal(ScanResult.Virus, result);
        }
示例#2
0
        private ScanResult GetScanResult(string fileName)
        {
            if (fileAccess.FileExists(fileName))
            {
                try
                {
                    fileAccess.DeleteFile(fileName);
                }
                catch (IOException)
                {
                    // If we can't delete the file just leave it
                }

                return(ScanResult.Clean);
            }
            return(ScanResult.Virus);
        }