1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-22 17:58:48 +00:00

Add integration tests

This commit is contained in:
Oliver Booth 2022-11-27 15:36:56 +00:00
parent 56aae0116e
commit f1abc4374a
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
5 changed files with 104 additions and 0 deletions

Binary file not shown.

View 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>

Binary file not shown.

View 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
View 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