Esempio n. 1
0
        public void VerifyFileChecksum_Pass(string algoritm, string hash)
        {
            var task = new VerifyChecksum
            {
                File        = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
                BuildEngine = new MockEngine(),
                Algorithm   = algoritm,
                Hash        = hash,
            };

            Assert.True(task.Execute(), "Task should pass");
        }
Esempio n. 2
0
        public void VerifyFileChecksum_Fails(string algoritm, string hash)
        {
            var task = new VerifyChecksum
            {
                File        = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
                BuildEngine = new MockEngine {
                    ContinueOnError = true
                },
                Algorithm = algoritm,
                Hash      = hash,
            };

            Assert.False(task.Execute(), "Task should fail");
        }