Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/SparkPost.Tests/CastingHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace SparkPost.Tests
{
public static class CastingHelpers
{
public static T CastAs<T>(this object @object) where T : class
{
return @object as T;
}

public static T CastTo<T>(this object @object)
{
return (T)@object;
}
}
}
10 changes: 5 additions & 5 deletions src/SparkPost.Tests/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using AutoMoq.Helpers;
using NUnit.Framework;
using Should;
using Shouldly;

namespace SparkPost.Tests
{
Expand Down Expand Up @@ -46,7 +46,7 @@ public void It_should_allow_the_overriding_of_the_http_client_building()
[Test]
public void It_should_default_to_async()
{
client.CustomSettings.SendingMode.ShouldEqual(SendingModes.Async);
client.CustomSettings.SendingMode.ShouldBe(SendingModes.Async);
}

[Test]
Expand All @@ -59,7 +59,7 @@ public void it_should_have_inbound_domains()
public void It_should_set_any_subaccount_id_passed_to_it()
{
(new Client(Guid.NewGuid().ToString(), 1234))
.SubaccountId.ShouldEqual(1234);
.SubaccountId.ShouldBe(1234);
}
}

Expand All @@ -75,15 +75,15 @@ public void Setup()
[Test]
public void It_should_default_to_the_library_version()
{
Subject.UserAgent.ShouldEqual($"csharp-sparkpost/1.14.0");
Subject.UserAgent.ShouldBe($"csharp-sparkpost/1.14.0");
}

[Test]
public void It_should_allow_the_user_agent_to_be_changed()
{
var userAgent = Guid.NewGuid().ToString();
Subject.UserAgent = userAgent;
Subject.UserAgent.ShouldEqual(userAgent);
Subject.UserAgent.ShouldBe(userAgent);
}
}
}
Expand Down
Loading