示例#1
0
        public void RetroIdentifier_CreateNew_CreatesIdOfLengthLessThanOrEqualTo32()
        {
            // Given / when
            RetroIdentifier retroIdentifier = this._retroIdentifierService.CreateNew();

            // Then
            Assert.That(retroIdentifier.StringId, Has.Length.LessThanOrEqualTo(32), $"Id {retroIdentifier} is not valid");
        }
示例#2
0
        public void RetroIdentifier_CreateNew_CreatesValidId()
        {
            // Given
            RetroIdentifier retroIdentifier = this._retroIdentifierService.CreateNew();

            // When
            bool isValid = this._retroIdentifierService.IsValid(retroIdentifier.StringId);

            // Then
            Assert.IsTrue(isValid, $"Id {retroIdentifier} is not valid");
        }
示例#3
0
        public void RetroIdentifier_CreateNew_ReturnsRandomId()
        {
            // Given
            var generatedIds = new HashSet <string>(1000);

            // When / then
            for (int count = 1000; count > 0; count--)
            {
                RetroIdentifier identifier = this._retroIdentifierService.CreateNew();

                Assert.That(generatedIds.Add(identifier.StringId), Is.True, $"Non-unique identifier created: {identifier}");
            }
        }
示例#4
0
        public Uri GenerateUrlToRetrospectiveLobby(RetroIdentifier urlId)
        {
            if (urlId == null)
            {
                throw new ArgumentNullException(nameof(urlId));
            }

            var uriBuilder = new UriBuilder(this._siteUrlDetectionService.GetSiteUrl())
            {
                Path = $"/retrospective/{urlId.StringId}/join"
            };

            return(uriBuilder.Uri);
        }
示例#5
0
 public CreateRetrospectiveCommandResponse(RetroIdentifier identifier, QrCode qrCode, string location)
 {
     this.Identifier = identifier;
     this.QrCode     = qrCode;
     this.Location   = location;
 }