public async void InMemoryHandler_UsesUniquenessRef() { var sut = new InMemoryHandler(); sut.SetFormatter(new FlimFlamV2Formatter()); sut.ClearOnGet = false; var msg = TestHelper.GetMessageMetaData(); await sut.HandleMessageAsync(msg); sut.SetFormatter(new FlimFlamV2Formatter()); string first = sut.GetMessage(); string second = sut.GetMessage(); await sut.HandleMessageAsync(msg); ///When a formatter does not contain a uniqueness reference this string is used in its place Assert.DoesNotContain(BaseMessageFormatter.DEFAULT_UQR, first); Assert.Equal(first, second); }
public async void EachMessage_HasUniqueness() { var sut = new InMemoryHandler(); sut.SetFormatter(new FlimFlamV2Formatter()); sut.ClearOnGet = false; var msg = TestHelper.GetMessageMetaData(10); await sut.HandleMessageAsync(msg); sut.SetFormatter(new FlimFlamV2Formatter()); var allMsgs = sut.GetAllMessages(); List <string> pastMessages = new List <string>(); foreach (var f in allMsgs) { foreach (var l in pastMessages) { Assert.NotEqual(l, f); } pastMessages.Add(f); } }