public void PrepareIds() { var guid = Guid.NewGuid().ToString(); Id = new CounterId(guid); Id2 = new CounterId(guid); }
public void CompareIds() { Assert.IsTrue(Id == Id2); Assert.IsFalse(Id != Id2); Assert.IsFalse(Id == null); Assert.IsTrue(Id != null); Id = null; Assert.IsTrue(Id == null); }
public void Setup() { var serviceProvider = new ServiceCollection() .AddLogging() .BuildServiceProvider(); var logger = serviceProvider.GetService <ILogger <Repository <TestCounter, string> > >(); var settings = new MongoDbSettings(MongoDefaultSettings.ConnectionString, "Tests"); context = new MongoDbContext(settings); repository = new Repository <TestCounter, string>(context, settings, logger); id = TypedId.GetNewId <CounterId>(); repository.InsertNewAsync(TestCounter.Create(id.Value, 0)).GetAwaiter().GetResult(); }
public CounterCreatedEvent(CounterId counterId, int value) { this.counterId = counterId; this.value = value; }
public TestCounter(CounterId counterId, int value) { this.Id = counterId; this.CounterValue = value; AddEvent(new CounterCreatedEvent(counterId, value)); }