mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-22 06:38:47 +00:00
Add integration tests
This commit is contained in:
parent
56aae0116e
commit
f1abc4374a
BIN
VpSharp.IntegrationTests/VPSDK.dll
Normal file
BIN
VpSharp.IntegrationTests/VPSDK.dll
Normal file
Binary file not shown.
23
VpSharp.IntegrationTests/VpSharp.IntegrationTests.csproj
Normal file
23
VpSharp.IntegrationTests/VpSharp.IntegrationTests.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VpSharp\VpSharp.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="libvpsdk.so">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VPSDK.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
BIN
VpSharp.IntegrationTests/libvpsdk.so
Normal file
BIN
VpSharp.IntegrationTests/libvpsdk.so
Normal file
Binary file not shown.
45
VpSharp.IntegrationTests/src/Program.cs
Normal file
45
VpSharp.IntegrationTests/src/Program.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using VpSharp;
|
||||
using VpSharp.Entities;
|
||||
|
||||
string? username = Environment.GetEnvironmentVariable("username");
|
||||
string? password = Environment.GetEnvironmentVariable("password");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
Console.Error.WriteLine("username env variable cannot be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(password))
|
||||
{
|
||||
Console.Error.WriteLine("password env variable cannot be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
var configuration = new VirtualParadiseConfiguration()
|
||||
{
|
||||
Username = username,
|
||||
Password = password,
|
||||
Application = new Application("VpSharp.IntegrationTests", "1.0.0"),
|
||||
AutoQuery = false,
|
||||
BotName = "TestBot"
|
||||
};
|
||||
|
||||
using var client = new VirtualParadiseClient(configuration);
|
||||
|
||||
Console.WriteLine(@"Connecting to universe");
|
||||
await client.ConnectAsync().ConfigureAwait(false);
|
||||
|
||||
Console.WriteLine(@"Logging in");
|
||||
await client.LoginAsync();
|
||||
|
||||
Console.WriteLine(@"Entering world");
|
||||
VirtualParadiseWorld world = await client.EnterAsync("Mutation");
|
||||
Console.WriteLine(@"Entered world!");
|
||||
|
||||
VirtualParadiseAvatar avatar = client.CurrentAvatar!;
|
||||
|
||||
Console.WriteLine($@"My name is {avatar.Name} and I am at {avatar.Location}");
|
||||
Console.WriteLine($@"Entered {world.Name} with size {world.Size}");
|
||||
|
||||
await Task.Delay(-1);
|
36
VpSharp.sln
Normal file
36
VpSharp.sln
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp", "VpSharp\VpSharp.csproj", "{D061712E-3832-4272-B684-D0A8415D7FF9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp.IntegrationTests", "VpSharp.IntegrationTests\VpSharp.IntegrationTests.csproj", "{0269A076-0FE4-4769-A662-BDCA61B2E6B2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp.Tests", "VpSharp.Tests\VpSharp.Tests.csproj", "{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{342BECE5-2E3B-4EC0-86D2-CC6A0FB30603}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
CONTRIBUTING.md = CONTRIBUTING.md
|
||||
LICENSE.md = LICENSE.md
|
||||
README.md = README.md
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D061712E-3832-4272-B684-D0A8415D7FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D061712E-3832-4272-B684-D0A8415D7FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D061712E-3832-4272-B684-D0A8415D7FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D061712E-3832-4272-B684-D0A8415D7FF9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Loading…
Reference in New Issue
Block a user