/// <summary> /// Gets the encrypted customer identifier. /// </summary> /// <returns></returns> public virtual string GetEncryptedCustomerId() { InitializeCustomerId(); ComposerCookieDto dto = CookieAccessor.Read(); return(dto.EncryptedCustomerId); }
public void WHEN_Passing_Valid_Parameters_SHOULD_Succeed() { // Arrange ICookieAccessor <ComposerCookieDto> accessor = _container.CreateInstance <ComposerCookieAccessor>(); // Act ComposerCookieDto dto = accessor.Read(); // Assert dto.Should().NotBeNull(); }
public void WHEN_Passing_Valid_Parameters_SHOULD_Succeed(string customerIdGuid, bool?isGuest) { // Arrange ICookieAccessor <ComposerCookieDto> accessor = _container.CreateInstance <ComposerCookieAccessor>(); Guid?customerId = customerIdGuid != null ? new Guid(customerIdGuid) : (Guid?)null; // Act ComposerCookieDto dto = accessor.Read(); dto.EncryptedCustomerId = new EncryptionUtility().Encrypt(customerId.ToString()); dto.IsGuest = isGuest; accessor.Write(dto); // Assert _container.Get <HttpResponseBase>().Cookies.Count.Should().BeGreaterThan(0); }