コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }