-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from Abc-Arbitrage/Directory.CQLV2
Directory: Update Cassandra schema of `Peers` and `DynamicSubscriptions` tables
- Loading branch information
Showing
48 changed files
with
183 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
...orage/StorageConvertionExtensionsTests.cs → ...ra.Tests/Data/CassandraExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
using System; | ||
using Abc.Zebus.Directory.Cassandra.Storage; | ||
using Abc.Zebus.Directory.Cassandra.Data; | ||
using Abc.Zebus.Testing.Extensions; | ||
using NUnit.Framework; | ||
|
||
namespace Abc.Zebus.Directory.Cassandra.Tests.Storage | ||
namespace Abc.Zebus.Directory.Cassandra.Tests.Data | ||
{ | ||
public class StorageConvertionExtensionsTests | ||
public class CassandraExtensionsTests | ||
{ | ||
[Test] | ||
public void should_return_a_storage_peer_with_its_timestamp_kind_set_to_utc() | ||
{ | ||
var unspecifiedKindUtcNow = new DateTime(DateTime.UtcNow.Ticks, DateTimeKind.Unspecified); | ||
var peerDescriptor = new PeerDescriptor(new PeerId("Abc.Titi.0"), "tcp://toto:123", false, true, true, unspecifiedKindUtcNow); | ||
|
||
var storagePeer = peerDescriptor.ToStoragePeer(); | ||
|
||
storagePeer.TimestampUtc.Kind.ShouldEqual(DateTimeKind.Utc); | ||
var peer = peerDescriptor.ToCassandra(); | ||
peer.TimestampUtc.Kind.ShouldEqual(DateTimeKind.Utc); | ||
} | ||
|
||
[Test] | ||
public void should_return_a_peer_descriptor_with_its_timestamp_kind_set_to_utc() | ||
{ | ||
var unspecifiedKindUtcNow = new DateTime(DateTime.UtcNow.Ticks, DateTimeKind.Unspecified); | ||
var storagePeer = new StoragePeer { TimestampUtc = unspecifiedKindUtcNow, StaticSubscriptionsBytes = new byte[0]}; | ||
|
||
var peerDescriptor = storagePeer.ToPeerDescriptor(new Subscription[0]); | ||
var peer = new CassandraPeer { TimestampUtc = unspecifiedKindUtcNow, StaticSubscriptionsBytes = new byte[0]}; | ||
|
||
var peerDescriptor = peer.ToPeerDescriptor(new Subscription[0]); | ||
peerDescriptor.TimestampUtc.Value.Kind.ShouldEqual(DateTimeKind.Utc); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.