Added NightAlert project for travel kit

This commit is contained in:
2021-06-10 14:39:06 -04:00
commit d38d9e3b7e
308 changed files with 35922 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
using Quobject.SocketIoClientDotNet.Client;
using Xunit;
namespace SocketIoClientDotNet.Tests.ClientTests
{
public class UrlTest
{
[Fact]
public void Parse()
{
const string test = @"http://username:password@host:8080/directory/file?query#ref";
var result = Url.Parse(test);
var str = result.ToString();
Assert.Equal(test,str);
}
[Fact]
public void ParseRelativePath()
{
const string test = @"https://woot.com/test";
var result = Url.Parse(test);
Assert.Equal("https",result.Scheme);
Assert.Equal("woot.com",result.Host);
Assert.Equal("/test",result.LocalPath);
}
[Fact]
public void ParseNoProtocol()
{
const string test = @"//localhost:3000";
var result = Url.Parse(test);
Assert.Equal("http", result.Scheme);
Assert.Equal("localhost", result.Host);
Assert.Equal(3000, result.Port);
}
[Fact]
public void ParseNamespace()
{
var result = Url.Parse(@"http://woot.com/woot");
Assert.Equal("/woot", result.LocalPath);
result = Url.Parse(@"http://google.com");
Assert.Equal("/", result.LocalPath);
result = Url.Parse(@"http://google.com/");
Assert.Equal("/", result.LocalPath);
}
}
}