PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Framework/src/Ncqrs.Tests/GuidCombGenerator.cs

http://github.com/ncqrs/ncqrs
C# | 28 lines | 23 code | 5 blank | 0 comment | 1 complexity | dbb25d2108a9556c60b23bcbdddd92de MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0
  1. using System;
  2. using System.Collections.Generic;
  3. using FluentAssertions;
  4. using Xunit;
  5. namespace Ncqrs.Tests
  6. {
  7. class GuidCombGeneratorTests
  8. {
  9. [Fact]
  10. public void Calling_generate_multiple_times_should_return_unique_results()
  11. {
  12. int count = 1000000;
  13. var generator = new GuidCombGenerator();
  14. var results = new List<Guid>();
  15. for (int i = 0; i < count; i++)
  16. {
  17. var id = generator.GenerateNewId();
  18. results.Add(id);
  19. }
  20. results.Should().OnlyHaveUniqueItems();
  21. }
  22. }
  23. }