Exemplo n.º 1
0
        public void CallsCorrectDirectory()
        {
            var fileStorage = MockRepository.GenerateMock <IFileStorageService>();
            var sut         = new LogsService(fileStorage);

            sut.GetLogs();
            fileStorage.AssertWasCalled(x => x.GetFiles(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ChocolateyGUI", "Logs")));
        }
Exemplo n.º 2
0
        public void CallsOnRunFinishedOnGetLogs()
        {
            var fileStorage = MockRepository.GenerateMock <IFileStorageService>();
            var sut         = new LogsService(fileStorage);
            var result      = 0;

            sut.RunFinished += start => result = 1;
            sut.GetLogs();
            Assert.AreEqual(1, result);
        }