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("\068\097\116\097\046\069\110\117\109\046\078\101\120\117\115\069\110\117\109\067\111\108\108\101\099\116\105\111\110")p:RegisterUnitTest("\067\111\110\115\116\114\117\099\116\111\114",function(p)local u=L.new()p:AssertEquals(u.ClassName,"\078\101\120\117\115\069\110\117\109\067\111\108\108\101\099\116\105\111\110","\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,"\078\101\120\117\115\069\110\117\109","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(u),"\078\101\120\117\115\069\110\117\109","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")end)p:RegisterUnitTest("\073\110\100\101\120\105\110\103",function(p)local u=L.new()local i=u:CreateEnum("\084\101\115\116\069\110\117\109\049")local o=u:CreateEnum("\084\101\115\116\069\110\117\109\049","\084\101\115\116\069\110\117\109\050")local F=u:CreateEnum("\084\101\115\116\069\110\117\109\049","\084\101\115\116\069\110\117\109\050","\084\101\115\116\069\110\117\109\051")local t=u:CreateEnum("\084\101\115\116\069\110\117\109\049","\084\101\115\116\069\110\117\109\050","\084\101\115\116\069\110\117\109\052")p:AssertEquals(tostring(i),"\078\101\120\117\115\069\110\117\109\046\084\101\115\116\069\110\117\109\049","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(o),"\078\101\120\117\115\069\110\117\109\046\084\101\115\116\069\110\117\109\049\046\084\101\115\116\069\110\117\109\050","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(F),"\078\101\120\117\115\069\110\117\109\046\084\101\115\116\069\110\117\109\049\046\084\101\115\116\069\110\117\109\050\046\084\101\115\116\069\110\117\109\051","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(t),"\078\101\120\117\115\069\110\117\109\046\084\101\115\116\069\110\117\109\049\046\084\101\115\116\069\110\117\109\050\046\084\101\115\116\069\110\117\109\052","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.TestEnum1,i,"\073\110\100\101\120\101\100 \101\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.TestEnum1.TestEnum2,o,"\073\110\100\101\120\101\100 \101\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.TestEnum1.TestEnum2.TestEnum3,F,"\073\110\100\101\120\101\100 \101\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.TestEnum1.TestEnum2.TestEnum4,t,"\073\110\100\101\120\101\100 \101\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.NormalId,Enum.NormalId,"\082\111\098\108\111\120 \069\110\117\109 \105\110\100\101\120 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(u.NormalId.Left,Enum.NormalId.Left,"\082\111\098\108\111\120 \069\110\117\109 \105\110\100\101\120 \105\115 \105\110\099\111\114\114\101\099\116\046")end)return true
--[[
TheNexusAvenger

Tests the NexusEnum class.
--]]

local NexusUnitTesting = require("NexusUnitTesting")

local NexusPluginFramework = require(game:GetService("ReplicatedStorage"):WaitForChild("NexusPluginFramework"))
local NexusEnumCollection = NexusPluginFramework:GetResource("Data.Enum.NexusEnumCollection")



--[[
Test that the constructor works without failing.
--]]
NexusUnitTesting:RegisterUnitTest("Constructor",function(UnitTest)
	local CuT = NexusEnumCollection.new()
	UnitTest:AssertEquals(CuT.ClassName,"NexusEnumCollection","Class name is incorrect.")
	UnitTest:AssertEquals(CuT.Name,"NexusEnum","Name is incorrect.")
	UnitTest:AssertEquals(tostring(CuT),"NexusEnum","Name is incorrect.")
end)


--[[
Tests that indexing is correct.
--]]
NexusUnitTesting:RegisterUnitTest("Indexing",function(UnitTest)
	--Create the component under testing.
	local CuT = NexusEnumCollection.new()
	
	--Create 4 enums.
	local TestEnum1 = CuT:CreateEnum("TestEnum1")
	local TestEnum2 = CuT:CreateEnum("TestEnum1","TestEnum2")
	local TestEnum3 = CuT:CreateEnum("TestEnum1","TestEnum2","TestEnum3")
	local TestEnum4 = CuT:CreateEnum("TestEnum1","TestEnum2","TestEnum4")
	
	--Assert the tostrings are correct.
	UnitTest:AssertEquals(tostring(TestEnum1),"NexusEnum.TestEnum1","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum2),"NexusEnum.TestEnum1.TestEnum2","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum3),"NexusEnum.TestEnum1.TestEnum2.TestEnum3","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum4),"NexusEnum.TestEnum1.TestEnum2.TestEnum4","Enum name is incorrect.")
	
	--Assert the indexes are correct.
	UnitTest:AssertEquals(CuT.TestEnum1,TestEnum1,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT.TestEnum1.TestEnum2,TestEnum2,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT.TestEnum1.TestEnum2.TestEnum3,TestEnum3,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT.TestEnum1.TestEnum2.TestEnum4,TestEnum4,"Indexed enum is incorrect.")
	
	--Assert Roblox enums are indexed correctly.
	UnitTest:AssertEquals(CuT.NormalId,Enum.NormalId,"Roblox Enum index is incorrect.")
	UnitTest:AssertEquals(CuT.NormalId.Left,Enum.NormalId.Left,"Roblox Enum index is incorrect.")
end)



return true