public void BuildEventIdentification_ShouldNotBeAffectedByIndex() { var hash1 = HashBuilder.BuildEventIdentification(_logEvent).Hash; _logEvent.Index = 123; var hash2 = HashBuilder.BuildEventIdentification(_logEvent).Hash; Assert.That(hash1, Is.EqualTo(hash2)); }
private void AssertHashNotSameAfterFunction(Action change) { var hash1 = HashBuilder.BuildEventIdentification(_logEvent).Hash; change.Invoke(); var hash2 = HashBuilder.BuildEventIdentification(_logEvent).Hash; Assert.That(hash1, Is.Not.EqualTo(hash2)); }
public void ReadEvents_ShouldUseOldEvent(int eventIndex) { _mockEventIdentificationStore.Expect(s => s.GetAlreadyReportedEventIdentification()).Return(HashBuilder.BuildEventIdentification(_events[eventIndex])); var result = _target.ReadEvents(); Assert.That(result.Count(), Is.EqualTo(eventIndex)); // Events returned until the old event timestamp + hash encountered }
public void BuildEventIdentification_ShouldUseEventTimeGenerated() { Assert.That(HashBuilder.BuildEventIdentification(_logEvent).TimeStampUtc, Is.EqualTo(_logEvent.TimeGenerated.ToUniversalTime())); }
public void BuildEventIdentification_ShouldGenerateSameHash() { Assert.That(HashBuilder.BuildEventIdentification(_logEvent).Hash, Is.EqualTo(HashBuilder.BuildEventIdentification(_logEvent).Hash)); }