Skip to content

Commit

Permalink
Remove Wire integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 24, 2022
1 parent 3369305 commit f068357
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions tests/RazorRockstars.Console.Files/MsgPackServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

namespace RazorRockstars.Console.Files
{
using ServiceStack.Wire;

public class MsgPackEmail
{
public string ToAddress { get; set; }
Expand Down Expand Up @@ -156,75 +154,4 @@ public void Can_serialize_email_dto_generic()
}
}
}

[TestFixture]
public class WireServiceTests
{
protected const string ListeningOn = "http://localhost:3337/";

AppHost appHost;

[OneTimeSetUp]
public void OnTestFixtureSetUp()
{
LogManager.LogFactory = new ConsoleLogFactory();

appHost = new AppHost { EnableRazor = false };
appHost.Plugins.Add(new WireFormat());
appHost.Init();
appHost.Start(ListeningOn);
}

[OneTimeTearDown]
public void OnTestFixtureTearDown()
{
Dispose();
}

public void Dispose()
{
appHost?.Dispose();
}

MsgPackEmail request = new MsgPackEmail
{
ToAddress = "to@email.com",
FromAddress = "from@email.com",
Subject = "Subject",
Body = "Body",
AttachmentData = Encoding.UTF8.GetBytes("AttachmentData"),
};

[Test]
public void Can_Send_Wire_request()
{
var client = new WireServiceClient(ListeningOn);

try
{
var response = client.Send<MsgPackEmail>(request);

Assert.That(response.Equals(request));
}
catch (WebServiceException webEx)
{
Assert.Fail(webEx.Message);
}
}

[Test]
public void Can_serialize_email_dto()
{
using (var ms = new MemoryStream())
{
WireFormat.Serialize(request, ms);

ms.Position = 0;

var response = WireFormat.Deserialize(request.GetType(), ms);

Assert.That(response.Equals(request));
}
}
}
}

0 comments on commit f068357

Please sign in to comment.