--[[----------------------------------------------------------------------------

WFOzUserDeviceManagementTest.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2021 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remains the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and are protected by all applicable
intellectual property laws, including trade secret and copyright laws.
Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

------------------------------------------------------------------------------]]

-- WF.core.self_test
local WFRxTestCase = require 'WFRxTestCase'

-- WF.core.utils
local KSIdGenerator = require 'KSIdGenerator'

-- WF.oz_client.user
local WFOzUserDeviceManagement = require 'WFOzUserDeviceManagement'

-- WF.oz_client.managed_catalog.sync
local WFCatUser = require 'WFCatUser'

--============================================================================--

-- @mark WFOzUserDeviceManagementTest

local WFOzUserDeviceManagementTest = {}

--------------------------------------------------------------------------------

function WFOzUserDeviceManagementTest.rxTestRegisterDeviceToken( rxTest )

	local user = WFCatUser( 'https://photos.adobe.io', KSIdGenerator.uuidInLowercaseHex(), ':memory:' )
	local deviceToken = KSIdGenerator.uuidInLowercaseHex()

	rxTest:expectSingleValue( WFOzUserDeviceManagement.registerDeviceToken( user, deviceToken), user)

end

--------------------------------------------------------------------------------

function WFOzUserDeviceManagementTest.rxTestDeleteDeviceToken( rxTest )

	local user = WFCatUser( 'https://photos.adobe.io', KSIdGenerator.uuidInLowercaseHex(), ':memory:' )
	local deviceToken = KSIdGenerator.uuidInLowercaseHex()
	local compareUrl = 'https://photos.adobe.io/' .. deviceToken

	rxTest:expectSingleValue( WFOzUserDeviceManagement.deleteDeviceToken( user, compareUrl), user)

end

return WFRxTestCase.wrapSuite( WFOzUserDeviceManagementTest )
