Browse Source

Build fixed.

pull/157/head
Sebastian Stehle 9 years ago
parent
commit
c7e12525b4
  1. 2
      tests/Benchmarks/Tests/HandleEvents.cs
  2. 2
      tests/Benchmarks/Tests/HandleEventsWithManyWriters.cs
  3. 2
      tests/Squidex.Infrastructure.Tests/Actors/ActorRemoteTests.cs
  4. 4
      tests/Squidex.Infrastructure.Tests/CQRS/Events/EventDataFormatterTests.cs
  5. 18
      tests/Squidex.Infrastructure.Tests/TypeNameRegistryTests.cs

2
tests/Benchmarks/Tests/HandleEvents.cs

@ -21,7 +21,7 @@ namespace Benchmarks.Tests
public sealed class HandleEvents : IBenchmark
{
private const int NumEvents = 5000;
private readonly TypeNameRegistry typeNameRegistry = new TypeNameRegistry().MapUnmapped(typeof(MyEvent));
private readonly TypeNameRegistry typeNameRegistry = new TypeNameRegistry().Map(typeof(MyEvent));
private readonly EventDataFormatter formatter;
private readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings();
private IMongoClient mongoClient;

2
tests/Benchmarks/Tests/HandleEventsWithManyWriters.cs

@ -23,7 +23,7 @@ namespace Benchmarks.Tests
{
private const int NumCommits = 200;
private const int NumStreams = 10;
private readonly TypeNameRegistry typeNameRegistry = new TypeNameRegistry().MapUnmapped(typeof(MyEvent));
private readonly TypeNameRegistry typeNameRegistry = new TypeNameRegistry().Map(typeof(MyEvent));
private readonly EventDataFormatter formatter;
private readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings();
private IMongoClient mongoClient;

2
tests/Squidex.Infrastructure.Tests/Actors/ActorRemoteTests.cs

@ -49,7 +49,7 @@ namespace Squidex.Infrastructure.Actors
public ActorRemoteTests()
{
registry.MapUnmapped(typeof(SuccessMessage));
registry.Map(typeof(SuccessMessage));
actors = new RemoteActors(new DefaultRemoteActorChannel(new InMemoryPubSub(), registry));
actors.Connect("my", actor);

4
tests/Squidex.Infrastructure.Tests/CQRS/Events/EventDataFormatterTests.cs

@ -40,8 +40,8 @@ namespace Squidex.Infrastructure.CQRS.Events
{
serializerSettings.Converters.Add(new PropertiesBagConverter());
typeNameRegistry.MapUnmapped(typeof(MyEvent), "Event");
typeNameRegistry.MapUnmapped(typeof(MyOldEvent), "OldEvent");
typeNameRegistry.Map(typeof(MyEvent), "Event");
typeNameRegistry.Map(typeof(MyOldEvent), "OldEvent");
sut = new EventDataFormatter(typeNameRegistry, serializerSettings);
}

18
tests/Squidex.Infrastructure.Tests/TypeNameRegistryTests.cs

@ -30,7 +30,7 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_register_and_retrieve_types()
{
sut.MapUnmapped(typeof(int), "NumberField");
sut.Map(typeof(int), "NumberField");
Assert.Equal("NumberField", sut.GetName<int>());
Assert.Equal("NumberField", sut.GetName(typeof(int)));
@ -42,7 +42,7 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_register_from_attribute()
{
sut.MapUnmapped(typeof(MyType));
sut.Map(typeof(MyType));
Assert.Equal("my", sut.GetName<MyType>());
Assert.Equal("my", sut.GetName(typeof(MyType)));
@ -78,7 +78,7 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_register_fallback_name()
{
sut.MapUnmapped(typeof(MyType));
sut.Map(typeof(MyType));
sut.MapObsolete(typeof(MyType), "my-old");
Assert.Equal(typeof(MyType), sut.GetType("my"));
@ -88,24 +88,24 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_not_throw_exception_if_type_is_already_registered_with_same_name()
{
sut.MapUnmapped(typeof(long), "long");
sut.MapUnmapped(typeof(long), "long");
sut.Map(typeof(long), "long");
sut.Map(typeof(long), "long");
}
[Fact]
public void Should_throw_exception_if_type_is_already_registered()
{
sut.MapUnmapped(typeof(long), "long");
sut.Map(typeof(long), "long");
Assert.Throws<ArgumentException>(() => sut.MapUnmapped(typeof(long), "longer"));
Assert.Throws<ArgumentException>(() => sut.Map(typeof(long), "longer"));
}
[Fact]
public void Should_throw_exception_if_name_is_already_registered()
{
sut.MapUnmapped(typeof(short), "short");
sut.Map(typeof(short), "short");
Assert.Throws<ArgumentException>(() => sut.MapUnmapped(typeof(byte), "short"));
Assert.Throws<ArgumentException>(() => sut.Map(typeof(byte), "short"));
}
[Fact]

Loading…
Cancel
Save