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); }
public override Task <string> GetDefaultInventoryLocationIdAsync() { var payload = _testCookieAccessor.Read(); return(Task.FromResult(payload.ScopeAndLocationId)); }
private bool IsGuest(ICookieAccessor <ComposerCookieDto> cookieAccessor) { var dto = cookieAccessor.Read(); return(dto.IsGuest.GetValueOrDefault(true)); }