Skip to content

Commit 5e39c9c

Browse files
committed
Checking Embedio
1 parent 12ad684 commit 5e39c9c

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

Unosquare.Labs.EmbedIO.Samples/Unosquare.Labs.EmbedIO.Samples.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<Private>True</Private>
4848
</Reference>
4949
<Reference Include="Unosquare.Tubular, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\Tubular.ServerSide.0.9.14\lib\net45\Unosquare.Tubular.dll</HintPath>
50+
<HintPath>..\packages\Tubular.ServerSide.0.9.23\lib\net45\Unosquare.Tubular.dll</HintPath>
5151
<Private>True</Private>
5252
</Reference>
5353
</ItemGroup>
@@ -75,6 +75,10 @@
7575
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
7676
</Content>
7777
<Content Include="html\views\tubular.html" />
78+
<Content Include="Scripts\tubular\tubular-bundle.css" />
79+
<Content Include="Scripts\tubular\tubular-bundle.js" />
80+
<Content Include="Scripts\tubular\tubular-bundle.min.css" />
81+
<Content Include="Scripts\tubular\tubular-bundle.min.js" />
7882
<None Include="app.config" />
7983
<Content Include="html\scripts\app.constants.js">
8084
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Unosquare.Labs.EmbedIO.Samples/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<packages>
33
<package id="log4net" version="2.0.3" targetFramework="net45" />
44
<package id="System.Linq.Dynamic" version="1.0.4" targetFramework="net45" />
5-
<package id="Tubular" version="0.9.17" targetFramework="net45" />
6-
<package id="Tubular.ServerSide" version="0.9.14" targetFramework="net45" />
5+
<package id="Tubular" version="0.9.23" targetFramework="net45" />
6+
<package id="Tubular.ServerSide" version="0.9.23" targetFramework="net45" />
77
</packages>

Unosquare.Labs.EmbedIO.Tests/WebServerTest.cs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
using Unosquare.Labs.EmbedIO.Tests.TestObjects;
2-
3-
namespace Unosquare.Labs.EmbedIO.Tests
1+
namespace Unosquare.Labs.EmbedIO.Tests
42
{
53
using NUnit.Framework;
4+
using System;
65
using System.Globalization;
76
using System.Linq;
7+
using System.Threading;
88
using Unosquare.Labs.EmbedIO.Log;
99
using Unosquare.Labs.EmbedIO.Modules;
1010
using Unosquare.Labs.EmbedIO.Tests.Properties;
11-
using System.Threading;
12-
using System;
11+
using Unosquare.Labs.EmbedIO.Tests.TestObjects;
1312

1413
[TestFixture]
1514
public class WebServerTest
@@ -20,7 +19,6 @@ public class WebServerTest
2019
[Test]
2120
public void WebServerDefaultConstructor()
2221
{
23-
2422
var instance = new WebServer();
2523
Assert.AreEqual(instance.Log.GetType(), typeof (NullLog), "Default log is NullLog");
2624
Assert.IsNotNull(instance.Listener, "It has a HttpListener");
@@ -30,25 +28,28 @@ public void WebServerDefaultConstructor()
3028
[Test]
3129
public void WebserverCanBeDisposed()
3230
{
33-
CancellationTokenSource cts = new CancellationTokenSource();
34-
var instance = new WebServer("http://localhost:" + DefaultPort);
35-
var task = instance.RunAsync(cts.Token);
36-
cts.Cancel();
37-
try
38-
{
39-
task.Wait();
40-
} catch (AggregateException e)
41-
{
42-
if (e.GetBaseException() is OperationCanceledException)
31+
// TODO: I need to test
32+
var cts = new CancellationTokenSource();
33+
var instance = new WebServer("http://localhost:" + DefaultPort);
34+
var task = instance.RunAsync(cts.Token);
35+
cts.Cancel();
36+
37+
try
4338
{
44-
instance.Dispose();
45-
return;
46-
} else
39+
task.Wait();
40+
}
41+
catch (AggregateException e)
4742
{
48-
Assert.Fail("Must fail because of an OperationCanceledException");
43+
if (e.GetBaseException() is OperationCanceledException)
44+
{
45+
instance.Dispose();
46+
return;
47+
}
48+
49+
Assert.Fail("Must fail because of an OperationCanceledException");
4950
}
50-
}
51-
Assert.Fail("Must throw an AggregateException");
51+
52+
Assert.Fail("Must throw an AggregateException");
5253
}
5354

5455
[Test]
@@ -99,7 +100,7 @@ public void WebServerStaticMethodWithConsole()
99100
const string errorMessage = "THIS IS AN ERROR";
100101
var instance = WebServer.CreateWithConsole(Resources.ServerAddress);
101102

102-
Assert.AreEqual(instance.Log.GetType(), typeof(SimpleConsoleLog), "Log is SimpleConsoleLog");
103+
Assert.AreEqual(instance.Log.GetType(), typeof (SimpleConsoleLog), "Log is SimpleConsoleLog");
103104

104105
// TODO: Grab console output
105106
instance.Log.Error(errorMessage);

0 commit comments

Comments
 (0)