Пример #1
0
        public void ShouldGetPageContent()
        {
            var app = new NurlApplication();
            var commands = new string[] { "get", "-url", @"https://jcambray.github.io/fake.html" };
            var expectedString = @"<html>Hello!</html>";

            app.DispatchArgs(commands);
            var data = app.Datas;

            Assert.AreEqual(expectedString, data);
        }
Пример #2
0
        public void FileContentShouldBeEqualToStringVariable()
        {
            var commands = new string[] { "get", "-url", @"https://jcambray.github.io/fake.html","-save",@"c:\test\testfile.htm" };
            var expectedFileContent = @"<html>Hello!</html>";

            var app = new NurlApplication();
            app.DispatchArgs(commands);
            var fileContent = File.ReadAllText(@"c:\test\testfile.htm");

            Assert.AreEqual(expectedFileContent, fileContent);
        }
Пример #3
0
        public void TestConnection()
        {
            var app = new NurlApplication();

            //given
            var command = new String[] { "test", "-url", @"https://jcambray.github.io/fake.html", "-time", "3" };

            //when
            app.DispatchArgs(command);

            //then
            Assert.IsTrue(app.Time > 0);
        }
Пример #4
0
        static void Main(string[] args)
        {
            var app = new NurlApplication();

            app.DispatchArgs(args);
        }
Пример #5
0
 static void Main(string[] args)
 {
     var app = new NurlApplication();
     app.DispatchArgs(args);
 }