local p=require("\078\101\120\117\115\085\110\105\116\084\101\115\116\105\110\103")local u=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\120\117\115\080\108\117\103\105\110\070\114\097\109\101\119\111\114\107"))local L=u:GetResource("\080\108\117\103\105\110\046\078\101\120\117\115\083\116\117\100\105\111\084\104\101\109\101")p:RegisterUnitTest("\067\111\110\115\116\114\117\099\116\111\114\115",function(p)local u=L.new()p:AssertEquals(u.ClassName,"\078\101\120\117\115\083\116\117\100\105\111\084\104\101\109\101","\067\108\097\115\115 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.Name,"\070\097\108\108\098\097\099\107","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(u),"\070\097\108\108\098\097\099\107","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")local i,o=L.FromThemeEnum(),L.FromThemeEnum()p:AssertSame(i,o,"\084\104\101\109\101\115 \097\114\101\110\'\116 \099\097\099\104\101\100\046")end)p:RegisterUnitTest("\071\101\116\067\111\108\111\114",function(p)local u=L.new()p:AssertClose(u:GetColor(Enum.StudioStyleGuideColor.DialogMainButton),Color3.new(0,.635294,1),.001,"\067\111\108\111\114\115 \097\114\101\110\'\116 \099\108\111\115\101\046")p:AssertClose(u:GetColor("\068\105\097\108\111\103\077\097\105\110\066\117\116\116\111\110",Enum.StudioStyleGuideModifier.Selected),Color3.new(0,.454902,.741176),.001,"\067\111\108\111\114\115 \097\114\101\110\'\116 \099\108\111\115\101\046")p:AssertClose(u:GetColor("\068\105\097\108\111\103\077\097\105\110\066\117\116\116\111\110","\068\105\115\097\098\108\101\100"),Color3.new(.235294,.235294,.235294),.001,"\067\111\108\111\114\115 \097\114\101\110\'\116 \099\108\111\115\101\046")end)return true
--[[
TheNexusAvenger

Tests the NexusStudioTheme class.
--]]

local NexusUnitTesting = require("NexusUnitTesting")

local NexusPluginFramework = require(game:GetService("ReplicatedStorage"):WaitForChild("NexusPluginFramework"))
local NexusStudioTheme = NexusPluginFramework:GetResource("Plugin.NexusStudioTheme")



--[[
Test that the constructors work without failing.
--]]
NexusUnitTesting:RegisterUnitTest("Constructors",function(UnitTest)
	--Test the base constructor.
	local CuT1 = NexusStudioTheme.new()
	UnitTest:AssertEquals(CuT1.ClassName,"NexusStudioTheme","Class name is incorrect.")
	UnitTest:AssertEquals(CuT1.Name,"Fallback","Name is incorrect.")
	UnitTest:AssertEquals(tostring(CuT1),"Fallback","Name is incorrect.")
	
	--Test the cahce constructor.
	local CuT2,CuT3 = NexusStudioTheme.FromThemeEnum(),NexusStudioTheme.FromThemeEnum()
	UnitTest:AssertSame(CuT2,CuT3,"Themes aren't cached.")
end)

--[[
Tests the GetColor method.
--]]
NexusUnitTesting:RegisterUnitTest("GetColor",function(UnitTest)
	--Create the component under testing.
	local CuT = NexusStudioTheme.new()
	
	--Run the assertions.
	UnitTest:AssertClose(CuT:GetColor(Enum.StudioStyleGuideColor.DialogMainButton),Color3.new(0,0.635294,1),0.001,"Colors aren't close.")
	UnitTest:AssertClose(CuT:GetColor("DialogMainButton",Enum.StudioStyleGuideModifier.Selected),Color3.new(0,0.454902,0.741176),0.001,"Colors aren't close.")
	UnitTest:AssertClose(CuT:GetColor("DialogMainButton","Disabled"),Color3.new(0.235294,0.235294,0.235294),0.001,"Colors aren't close.")
end)



return true