Exemplo n.º 1
0
        public void HasCorrectId()
        {
            var env = new Ex.Env();

            var i = new PathNotSymbolicLink().Init(env, "TEST", "file");

            Assert.Equal("PATH_TEST_SHOULD_NOT_REFER_TO_SYMBOLIC_LINK", i.Id);
        }
Exemplo n.º 2
0
        public void DetectsSymbolicLink()
        {
            var env = new Ex.Env();

            var i = new PathNotSymbolicLink {
                SymbolicLink = true
            }.Init(env, "TEST", "file");

            Assert.False(i.Ok);
        }
Exemplo n.º 3
0
        public void IsRobust()
        {
            var env = new Ex.Env();

            string    message   = null;
            Exception exception = null;

            env.Reporter.OnExceptionReported = (msg, ex) =>
            {
                message   = msg;
                exception = ex;
            };

            var i = new PathNotSymbolicLink
            {
                ThrowException = new Exception("fubar")
            }.Init(env, "TEST", "file");

            Assert.True(i.Ok);
            Assert.Equal("DoesPathPointToSymbolicLink bombed for file", message);
            Assert.Equal("BOOM!", exception.Message);
            Assert.Equal("fubar", exception.InnerException.Message);
        }