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")p:RegisterUnitTest("\067\111\110\115\116\114\117\099\116\111\114",function(p)local u=L.new("\084\101\115\116\069\110\117\109")p:AssertEquals(u.ClassName,"\078\101\120\117\115\069\110\117\109","\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,"\084\101\115\116\069\110\117\109","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(u),"\084\101\115\116\069\110\117\109","\078\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")end)p:RegisterUnitTest("\071\101\116\069\110\117\109",function(p)local u=L.new("\084\101\115\116\069\110\117\109\049")local i=L.new("\084\101\115\116\069\110\117\109\050")local o=L.new("\084\101\115\116\069\110\117\109\051")local F=L.new("\084\101\115\116\069\110\117\109\052")u:AddEnum(i)i:AddEnum(o)i:AddEnum(F)p:AssertEquals(u:GetEnum("\084\101\115\116\069\110\117\109\049"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(u:GetEnum("\084\101\115\116\069\110\117\109\050"),i,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(u:GetEnum("\084\101\115\116\069\110\117\109\051"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(u:GetEnum("\084\101\115\116\069\110\117\109\052"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(i:GetEnum("\084\101\115\116\069\110\117\109\049"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(i:GetEnum("\084\101\115\116\069\110\117\109\050"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(i:GetEnum("\084\101\115\116\069\110\117\109\051"),o,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(i:GetEnum("\084\101\115\116\069\110\117\109\052"),F,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(o:GetEnum("\084\101\115\116\069\110\117\109\049"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(o:GetEnum("\084\101\115\116\069\110\117\109\050"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(o:GetEnum("\084\101\115\116\069\110\117\109\051"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(o:GetEnum("\084\101\115\116\069\110\117\109\052"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(F:GetEnum("\084\101\115\116\069\110\117\109\049"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(F:GetEnum("\084\101\115\116\069\110\117\109\050"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(F:GetEnum("\084\101\115\116\069\110\117\109\051"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")p:AssertEquals(F:GetEnum("\084\101\115\116\069\110\117\109\052"),nil,"\069\110\117\109 \105\115 \105\110\099\099\111\114\114\101\099\116\046")end)p:RegisterUnitTest("\065\100\100\069\110\117\109",function(p)local u=L.new("\084\101\115\116\069\110\117\109\049")local i=L.new("\084\101\115\116\069\110\117\109\050")local o=L.new("\084\101\115\116\069\110\117\109\051")local F=L.new("\084\101\115\116\069\110\117\109\052")u:AddEnum(i)i:AddEnum(o)i:AddEnum(F)p:AssertEquals(tostring(u),"\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(i),"\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(o),"\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(F),"\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")local t=i:GetEnumItems()if not(t[1]==o and t[2]==F)and not(t[1]==F and t[2]==o)then p:Fail("\069\110\117\109 \105\116\101\109\115 \108\105\115\116 \105\115 \105\110\099\111\114\114\101\099\116\046")end p:AssertEquals(u:GetEnumItems(),{i},"\069\110\117\109 \105\116\101\109 \108\105\115\116 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(o:GetEnumItems(),{},"\069\110\117\109 \105\116\101\109 \108\105\115\116 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(F:GetEnumItems(),{},"\069\110\117\109 \105\116\101\109 \108\105\115\116 \105\115 \105\110\099\111\114\114\101\099\116\046")end)p:RegisterUnitTest("\067\114\101\097\116\101\069\110\117\109",function(p)local u=L.new("\084\101\115\116\069\110\117\109\049")local i=u:CreateEnum("\084\101\115\116\069\110\117\109\050")local o=u:CreateEnum("\084\101\115\116\069\110\117\109\051")local F=u:CreateEnum("\084\101\115\116\069\110\117\109\051")local t=u:CreateEnum("\084\101\115\116\069\110\117\109\050","\084\101\115\116\069\110\117\109\052")local C=u:CreateEnum("\084\101\115\116\069\110\117\109\050","\084\101\115\116\069\110\117\109\053")local j=u:CreateEnum("\084\101\115\116\069\110\117\109\051","\084\101\115\116\069\110\117\109\054")p:AssertSame(o,F,"\068\117\112\108\105\099\097\116\101 \101\110\117\109\115 \099\114\101\097\116\101\100\046")p:AssertEquals(tostring(i),"\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(i,u.TestEnum2,"\069\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(o),"\084\101\115\116\069\110\117\109\049\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(F),"\084\101\115\116\069\110\117\109\049\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(o,u.TestEnum3,"\069\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(t),"\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(t,u.TestEnum2.TestEnum4,"\069\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(C),"\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\053","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(C,u.TestEnum2.TestEnum5,"\069\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(tostring(j),"\084\101\115\116\069\110\117\109\049\046\084\101\115\116\069\110\117\109\051\046\084\101\115\116\069\110\117\109\054","\069\110\117\109 \110\097\109\101 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertEquals(j,u.TestEnum3.TestEnum6,"\069\110\117\109 \105\115 \105\110\099\111\114\114\101\099\116\046")end)p:RegisterUnitTest("\069\113\117\097\108\115",function(p)local u=L.new("\084\101\115\116\069\110\117\109\049")local i=u:CreateEnum("\084\101\115\116\069\110\117\109\050")local o=u:CreateEnum("\084\101\115\116\069\110\117\109\051")p:AssertTrue(u:Equals(u),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(u:Equals(i),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(u:Equals(o),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertTrue(u:Equals("\084\101\115\116\069\110\117\109\049"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(u:Equals("\084\101\115\116\069\110\117\109\050"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(u:Equals("\084\101\115\116\069\110\117\109\051"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(i:Equals(u),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertTrue(i:Equals(i),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(i:Equals(o),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(i:Equals("\084\101\115\116\069\110\117\109\049"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertTrue(i:Equals("\084\101\115\116\069\110\117\109\050"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(i:Equals("\084\101\115\116\069\110\117\109\051"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(o:Equals(u),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(o:Equals(i),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertTrue(o:Equals(o),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(o:Equals("\084\101\115\116\069\110\117\109\049"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertFalse(o:Equals("\084\101\115\116\069\110\117\109\050"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \105\115 \105\110\099\111\114\114\101\099\116\046")p:AssertTrue(o:Equals("\084\101\115\116\069\110\117\109\051"),"\069\110\117\109 \101\113\117\097\108\105\116\121 \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("\084\101\115\116\069\110\117\109\049")local i=L.new("\084\101\115\116\069\110\117\109\050")local o=L.new("\084\101\115\116\069\110\117\109\051")local F=L.new("\084\101\115\116\069\110\117\109\052")u:AddEnum(i)i:AddEnum(o)i:AddEnum(F)p:AssertEquals(u.TestEnum2,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.TestEnum2.TestEnum3,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.TestEnum2.TestEnum4,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(i.TestEnum3,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(i.TestEnum4,F,"\073\110\100\101\120\101\100 \101\110\117\109 \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 NexusEnum = NexusPluginFramework:GetResource("Data.Enum.NexusEnum")



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


--[[
Tests the GetEnum method.
--]]
NexusUnitTesting:RegisterUnitTest("GetEnum",function(UnitTest)
	--Create 4 components under testing.
	local CuT1 = NexusEnum.new("TestEnum1")
	local CuT2 = NexusEnum.new("TestEnum2")
	local CuT3 = NexusEnum.new("TestEnum3")
	local CuT4 = NexusEnum.new("TestEnum4")
	
	--Add the enums.
	CuT1:AddEnum(CuT2)
	CuT2:AddEnum(CuT3)
	CuT2:AddEnum(CuT4)
	
	--Assert the get methods are correct.
	UnitTest:AssertEquals(CuT1:GetEnum("TestEnum1"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT1:GetEnum("TestEnum2"),CuT2,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT1:GetEnum("TestEnum3"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT1:GetEnum("TestEnum4"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT2:GetEnum("TestEnum1"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT2:GetEnum("TestEnum2"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT2:GetEnum("TestEnum3"),CuT3,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT2:GetEnum("TestEnum4"),CuT4,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT3:GetEnum("TestEnum1"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT3:GetEnum("TestEnum2"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT3:GetEnum("TestEnum3"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT3:GetEnum("TestEnum4"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT4:GetEnum("TestEnum1"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT4:GetEnum("TestEnum2"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT4:GetEnum("TestEnum3"),nil,"Enum is inccorrect.")
	UnitTest:AssertEquals(CuT4:GetEnum("TestEnum4"),nil,"Enum is inccorrect.")
end)

--[[
Tests the AddEnum method.
--]]
NexusUnitTesting:RegisterUnitTest("AddEnum",function(UnitTest)
	--Create 4 components under testing.
	local CuT1 = NexusEnum.new("TestEnum1")
	local CuT2 = NexusEnum.new("TestEnum2")
	local CuT3 = NexusEnum.new("TestEnum3")
	local CuT4 = NexusEnum.new("TestEnum4")
	
	--Add the enums.
	CuT1:AddEnum(CuT2)
	CuT2:AddEnum(CuT3)
	CuT2:AddEnum(CuT4)
	
	--Assert the names are correct.
	UnitTest:AssertEquals(tostring(CuT1),"TestEnum1","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(CuT2),"TestEnum1.TestEnum2","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(CuT3),"TestEnum1.TestEnum2.TestEnum3","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(CuT4),"TestEnum1.TestEnum2.TestEnum4","Enum name is incorrect.")
	
	--Assert the lists are correct.
	local CuT2EnumItems = CuT2:GetEnumItems()
	if not (CuT2EnumItems[1] == CuT3 and CuT2EnumItems[2] == CuT4) and not (CuT2EnumItems[1] == CuT4 and CuT2EnumItems[2] == CuT3) then
		UnitTest:Fail("Enum items list is incorrect.")
	end
	UnitTest:AssertEquals(CuT1:GetEnumItems(),{CuT2},"Enum item list is incorrect.")
	UnitTest:AssertEquals(CuT3:GetEnumItems(),{},"Enum item list is incorrect.")
	UnitTest:AssertEquals(CuT4:GetEnumItems(),{},"Enum item list is incorrect.")
end)

--[[
Tests the CreateEnum method.
--]]
NexusUnitTesting:RegisterUnitTest("CreateEnum",function(UnitTest)
	--Create the component under testing.
	local CuT = NexusEnum.new("TestEnum1")
	
	--Create several enums.
	local TestEnum2 = CuT:CreateEnum("TestEnum2")
	local TestEnum3 = CuT:CreateEnum("TestEnum3")
	local TestEnum3Duplicate = CuT:CreateEnum("TestEnum3")
	local TestEnum4 = CuT:CreateEnum("TestEnum2","TestEnum4")
	local TestEnum5 = CuT:CreateEnum("TestEnum2","TestEnum5")
	local TestEnum6 = CuT:CreateEnum("TestEnum3","TestEnum6")
	
	--Assert the duplicate create isn't duplicate.
	UnitTest:AssertSame(TestEnum3,TestEnum3Duplicate,"Duplicate enums created.")
	
	--Assert the enums are correct.
	UnitTest:AssertEquals(tostring(TestEnum2),"TestEnum1.TestEnum2","Enum name is incorrect.")
	UnitTest:AssertEquals(TestEnum2,CuT.TestEnum2,"Enum is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum3),"TestEnum1.TestEnum3","Enum name is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum3Duplicate),"TestEnum1.TestEnum3","Enum name is incorrect.")
	UnitTest:AssertEquals(TestEnum3,CuT.TestEnum3,"Enum is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum4),"TestEnum1.TestEnum2.TestEnum4","Enum name is incorrect.")
	UnitTest:AssertEquals(TestEnum4,CuT.TestEnum2.TestEnum4,"Enum is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum5),"TestEnum1.TestEnum2.TestEnum5","Enum name is incorrect.")
	UnitTest:AssertEquals(TestEnum5,CuT.TestEnum2.TestEnum5,"Enum is incorrect.")
	UnitTest:AssertEquals(tostring(TestEnum6),"TestEnum1.TestEnum3.TestEnum6","Enum name is incorrect.")
	UnitTest:AssertEquals(TestEnum6,CuT.TestEnum3.TestEnum6,"Enum is incorrect.")
end)

--[[
Tests the Equals method.
--]]
NexusUnitTesting:RegisterUnitTest("Equals",function(UnitTest)
	--Create the components under testing.
	local CuT1 = NexusEnum.new("TestEnum1")
	local CuT2 = CuT1:CreateEnum("TestEnum2")
	local CuT3 = CuT1:CreateEnum("TestEnum3")
	
	--Run the assertions.
	UnitTest:AssertTrue(CuT1:Equals(CuT1),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT1:Equals(CuT2),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT1:Equals(CuT3),"Enum equality is incorrect.")
	UnitTest:AssertTrue(CuT1:Equals("TestEnum1"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT1:Equals("TestEnum2"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT1:Equals("TestEnum3"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT2:Equals(CuT1),"Enum equality is incorrect.")
	UnitTest:AssertTrue(CuT2:Equals(CuT2),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT2:Equals(CuT3),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT2:Equals("TestEnum1"),"Enum equality is incorrect.")
	UnitTest:AssertTrue(CuT2:Equals("TestEnum2"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT2:Equals("TestEnum3"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT3:Equals(CuT1),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT3:Equals(CuT2),"Enum equality is incorrect.")
	UnitTest:AssertTrue(CuT3:Equals(CuT3),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT3:Equals("TestEnum1"),"Enum equality is incorrect.")
	UnitTest:AssertFalse(CuT3:Equals("TestEnum2"),"Enum equality is incorrect.")
	UnitTest:AssertTrue(CuT3:Equals("TestEnum3"),"Enum equality is incorrect.")
end)

--[[
Tests that indexing is correct.
--]]
NexusUnitTesting:RegisterUnitTest("Indexing",function(UnitTest)
	--Create 4 components under testing.
	local CuT1 = NexusEnum.new("TestEnum1")
	local CuT2 = NexusEnum.new("TestEnum2")
	local CuT3 = NexusEnum.new("TestEnum3")
	local CuT4 = NexusEnum.new("TestEnum4")
	
	--Add the enums.
	CuT1:AddEnum(CuT2)
	CuT2:AddEnum(CuT3)
	CuT2:AddEnum(CuT4)
	
	--Assert the indexes are correct.
	UnitTest:AssertEquals(CuT1.TestEnum2,CuT2,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT1.TestEnum2.TestEnum3,CuT3,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT1.TestEnum2.TestEnum4,CuT4,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT2.TestEnum3,CuT3,"Indexed enum is incorrect.")
	UnitTest:AssertEquals(CuT2.TestEnum4,CuT4,"Indexed enum is incorrect.")
end)



return true