Resolve WES-187 "Unit tests account and system"
This commit is contained in:
committed by
Jerome Coudron
parent
c4b6c60288
commit
b9bbef8dcf
27
Assets/Accounts/Tests/EditMode/UserAvatarListTests.cs
Normal file
27
Assets/Accounts/Tests/EditMode/UserAvatarListTests.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Test the UserAvatarList class
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class UserAvatarListTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Test the UserAvatarList class correctly initializes the UserList class
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Test_Awake()
|
||||
{
|
||||
UserList.AVATARS = new List<Sprite>();
|
||||
|
||||
var scriptableObject = AssetDatabase.LoadAssetAtPath<UserAvatarList>("Assets/Accounts/ScriptableObjects/UserAvatarList.asset");
|
||||
scriptableObject.Awake();
|
||||
|
||||
for (int i = 0; i < scriptableObject.avatars.Count; i++)
|
||||
Assert.AreEqual(scriptableObject.avatars[i], UserList.AVATARS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user