public void ConsumeCorrectlyUpdatesViewStore( [Frozen] Mock <IObserver <DateTime> > observerMock, MonthViewUpdater sut, SoldOutEvent @event) { sut.Handle(@event); observerMock.Verify(s => s.OnNext(@event.Date)); }
public void Consume(MakeReservationCommand message) { var blob = this.GetCapacityBlob(message); var originalCapacity = blob.DownloadItem(); var newCapacity = originalCapacity.Reserve( message.Quantity, message.Id); if (!newCapacity.Equals(originalCapacity)) { blob.Upload(newCapacity); if (newCapacity.Remaining <= 0) { var e = new SoldOutEvent(message.Date); this.channel.Send(e); } } }
public void EnvelopReturnsCorrectBody(SoldOutEvent sut) { var actual = sut.Envelop(); Assert.Equal(sut, actual.Body); }
public void DateIsCorrect([Frozen] DateTime date, SoldOutEvent sut) { Assert.Equal <DateTime>(date, sut.Date); }
public void IdIsStable(SoldOutEvent sut) { Assert.Equal(sut.Id, sut.Id); }
public void IdIsUnique(SoldOutEvent sut, SoldOutEvent other) { Assert.NotEqual(sut.Id, other.Id); }
public void SutIsMessage(SoldOutEvent sut) { Assert.IsAssignableFrom <IMessage>(sut); }
public void ConsumeCorrectlyUpdatesViewStore([Frozen] Mock <IMonthViewWriter> storeMock, MonthViewModelUpdater sut, SoldOutEvent @event) { sut.Consume(@event); storeMock.Verify(s => s.Disable(@event.Date)); }