Esempio n. 1
0
        public void TestDebugIsWellFormedPath()
        {
#if DEBUG
            var ex = Assert.Throws <ArgumentException>(() => DebugIoCode.IsWellFormedPath(@"\\invalid*path", "arg00"));
            Assert.That(ex.Message, Does.Contain("arg00"));
            Assert.That(ex.Message, Does.Contain(@"\\invalid*path"));
#else
            // ReSharper disable once InvocationIsSkipped
            Assert.DoesNotThrow(() => DebugIoCode.IsWellFormedPath(@"\\invalid*path", "arg00"));
#endif

            // ReSharper disable once InvocationIsSkipped
            Assert.DoesNotThrow(() => IoCode.IsWellFormedPath("maybe/path", "arg00"));
        }
Esempio n. 2
0
        public void TestIsWellFormedPath()
        {
            var ex = Assert.Throws <ArgumentException>(() => IoCode.IsWellFormedPath(@"\\invalid*path", "arg00"));

            Assert.That(ex.Message, Does.Contain("arg00"));
            Assert.That(ex.Message, Does.Contain(@"\\invalid*path"));

            ex = Assert.Throws <ArgumentException>(() => IoCode.IsWellFormedPath("", "arg00"));
            Assert.That(ex.Message, Does.Contain("arg00"));

            ex = Assert.Throws <ArgumentException>(() => IoCode.IsWellFormedPath(null, "arg00"));
            Assert.That(ex.Message, Does.Contain("arg00"));

            Assert.DoesNotThrow(() => IoCode.IsWellFormedPath(@"\\valid\path", "arg00"));
        }