~ruther/NosSmooth

ref: 3e52548e23c46738ce2194dd02c79fdce85959c3 NosSmooth/Tests/NosSmooth.Game.Tests/Modules/CharacterTests.cs -rw-r--r-- 1.4 KiB
3e52548e — František Boháček feat(core): split raw client and managed client as well as packet handlers 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
//  CharacterTests.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Xunit.Abstractions;

namespace NosSmooth.Game.Tests.Modules;

/// <summary>
/// Test for Game.Character.
/// </summary>
public class CharacterTests
{
    private readonly ITestOutputHelper _testOutputHelper;

    /// <summary>
    /// Initializes a new instance of the <see cref="CharacterTests"/> class.
    /// </summary>
    /// <param name="testOutputHelper">The test output helper.</param>
    public CharacterTests(ITestOutputHelper testOutputHelper)
    {
        _testOutputHelper = testOutputHelper;
    }

    /// <summary>
    /// Tests character initialization.
    /// </summary>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    [Fact]
    public async Task Test_Initialize()
    {
        var data = PacketFileClient.CreateFor<CharacterTests>("init", _testOutputHelper);

        await data.Client.ExecuteUntilLabelAsync("AFTER_INITIALIZED");
        data.Game.Character.ShouldNotBeNull();
        data.Game.Character.PlayerLevel.ShouldNotBeNull();
        data.Game.Character.PlayerLevel.Lvl.ShouldBe((short)99);
        data.Game.Character.JobLevel.ShouldNotBeNull();
        data.Game.Character.JobLevel.Lvl.ShouldBe((short)20);
    }
}
Do not follow this link