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

ADOBE CONFIDENTIAL
------------------
Copyright 2020 Adobe
All Rights Reserved.

NOTICE: All information contained herein is, and remains
the property of Adobe and its suppliers, if any. The intellectual
and technical concepts contained herein are proprietary to Adobe
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.

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

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

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

local WFPlatformInfoTest = {}

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

function WFPlatformInfoTest.rxTestGetArchitecture( rxTest )

	local getArchitecture = assert( WFPlatformInfo.getArchitecture )
	
	local architecture = getArchitecture()
	
	if WFPlatformInfo.isMobile() then
	
		rxTest:expectEqual( 'Unknown', architecture )
	
	else
		
		rxTest:expectNotEqual( nil, architecture )

		rxTest:expectNotEqual( 'Unknown', architecture )
	
	end

end

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

function WFPlatformInfoTest.rxTestisClassic( rxTest )

	WFCapabilities.setCapability( 'WFPlatformInfo.isClassic', 'true' )
	
	local isClassic = WFPlatformInfo.isClassic()
	local isNimbus = WFPlatformInfo.isNimbus()
	
	rxTest:finally( function()
		WFCapabilities.setCapability( 'WFPlatformInfo.isClassic', nil )
	end )
		
	rxTest:expectEqual( true, isClassic )
	rxTest:expectEqual( false, isNimbus )
	
end

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

function WFPlatformInfoTest.rxTestisNimbus( rxTest )

	local isNimbus = WFPlatformInfo.isNimbus()

	if WFPlatformInfo.isDesktop then
	
		rxTest:expectEqual( true, isNimbus )
		
	else 
		
		rxTest:expectEqual( false, isNimbus )
	
	end

end

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

return WFRxTestCase.wrapSuite( 'WFPlatformInfoTest', WFPlatformInfoTest )
