コード例 #1
0
        public void WHEN_Passing_Valid_Parameters_SHOULD_Succeed()
        {
            // Arrange
            ICookieAccessor <ComposerCookieDto> accessor = _container.CreateInstance <ComposerCookieAccessor>();

            // Act
            ComposerCookieDto dto = accessor.Read();

            // Assert
            dto.Should().NotBeNull();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public override Task <string> GetDefaultInventoryLocationIdAsync()
        {
            var payload = _testCookieAccessor.Read();

            return(Task.FromResult(payload.ScopeAndLocationId));
        }
コード例 #4
0
        private bool IsGuest(ICookieAccessor <ComposerCookieDto> cookieAccessor)
        {
            var dto = cookieAccessor.Read();

            return(dto.IsGuest.GetValueOrDefault(true));
        }