diff --git a/GamingAPIPlugins.sln b/GamingAPIPlugins.sln index be4d1e3..3235f8c 100644 --- a/GamingAPIPlugins.sln +++ b/GamingAPIPlugins.sln @@ -2,7 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 15.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamingAPIPlugins", "GamingAPIPlugins\GamingAPIPlugins.csproj", "{E3B20E54-ACFF-4CB1-A5EC-97EB6AB462EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GamingAPIPlugins", "GamingAPIPlugins\GamingAPIPlugins.csproj", "{E3B20E54-ACFF-4CB1-A5EC-97EB6AB462EF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject2", "UnitTestProject2\UnitTestProject2.csproj", "{55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -14,6 +16,10 @@ Global {E3B20E54-ACFF-4CB1-A5EC-97EB6AB462EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3B20E54-ACFF-4CB1-A5EC-97EB6AB462EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {E3B20E54-ACFF-4CB1-A5EC-97EB6AB462EF}.Release|Any CPU.Build.0 = Release|Any CPU + {55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GamingAPIPlugins/GamingAPIPlugins.csproj b/GamingAPIPlugins/GamingAPIPlugins.csproj index 5aaa262..e8a017b 100644 --- a/GamingAPIPlugins/GamingAPIPlugins.csproj +++ b/GamingAPIPlugins/GamingAPIPlugins.csproj @@ -451,4 +451,9 @@ + + + <_Parameter1>UnitTestProject2 + + \ No newline at end of file diff --git a/UnitTestProject2/GamingAPIPluginsTest.csproj b/UnitTestProject2/GamingAPIPluginsTest.csproj new file mode 100644 index 0000000..1f3d40a --- /dev/null +++ b/UnitTestProject2/GamingAPIPluginsTest.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {55C4CE6A-72BA-4EB0-B5FC-64FE1EC58547} + Library + Properties + UnitTestProject2 + UnitTestProject2 + v4.6.1 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\GamingAPIPlugins\Managed\Assembly-CSharp.dll + + + ..\GamingAPIPlugins\Managed\Oxide.Core.dll + + + + + + + + + + + 2.1.1 + + + 2.1.1 + + + + + {e3b20e54-acff-4cb1-a5ec-97eb6ab462ef} + GamingAPIPlugins + + + + + \ No newline at end of file diff --git a/UnitTestProject2/Properties/AssemblyInfo.cs b/UnitTestProject2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9610c9e --- /dev/null +++ b/UnitTestProject2/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("UnitTestProject2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnitTestProject2")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("55c4ce6a-72ba-4eb0-b5fc-64fe1ec58547")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/UnitTestProject2/UnitTest1.cs b/UnitTestProject2/UnitTest1.cs new file mode 100644 index 0000000..5eca65c --- /dev/null +++ b/UnitTestProject2/UnitTest1.cs @@ -0,0 +1,27 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using Oxide.Plugins; +using System.Reflection; +using System.Collections.Generic; +using ConVar; +using Oxide.Ext.GamingApi.MessageQueue; + +namespace Test +{ + [TestClass] + public class UnitTest1 + { + [TestMethod] + public void TestMethod1() + { + GamingAPI plugin = new GamingAPI(); + MethodInfo methodInfo = typeof(GamingAPI).GetMethod("OnPlayerChat", BindingFlags.NonPublic | BindingFlags.Instance); + var p = new BasePlayer(); + p.UserIDString = "test"; + p.displayName = "test"; + object[] parameters = { p, "test", Chat.ChatChannel.Global }; + methodInfo.Invoke(plugin, parameters); + Assert.AreEqual(GamingApiMessageQueue.Instance.GetCurrentMessagesInQueue(), 1); + } + } +}