Exemplo n.º 1
0
        public void AddSentry_MainDoesNotExist_ThrowsFileNotFoundException()
        {
            var pathToMain = "Path/That/Does/Not/Exist";
            var nativeMain = new NativeMain();

            var assert = Assert.Throws <FileNotFoundException>(() => nativeMain.AddSentry(pathToMain, null));

            StringAssert.Contains("Could not find main.", assert.Message);
        }
Exemplo n.º 2
0
        public void AddSentry_CleanMain_OutputMatchesExpected()
        {
            var expectedMain    = GetFileContents("main_expected.txt");
            var workingMainPath = "temp.txt";

            File.WriteAllText(workingMainPath, GetFileContents("main.txt"));
            var nativeMain = new NativeMain();

            nativeMain.AddSentry(workingMainPath, null);
            var actualMain = File.ReadAllText(workingMainPath);

            Assert.AreEqual(expectedMain, actualMain);

            File.Delete(workingMainPath);
        }