Annotations + Removal of unneeded lines
This commit is contained in:
committed by
Jerome Coudron
parent
8c69ec3cc6
commit
785e56b883
@@ -29,7 +29,7 @@ public class ChangeUserScreenTests
|
||||
private IEnumerator Setup_ChangeUserScreen_SingleUser(string startScreen = "Accounts/Scenes/ChangeUserScreen")
|
||||
{
|
||||
string path = $"{Application.persistentDataPath}/wesign_unit_test.json";
|
||||
string oneUser = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}";
|
||||
string oneUser = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}";
|
||||
|
||||
File.WriteAllText(path, oneUser);
|
||||
PersistentDataController.PATH = path;
|
||||
@@ -53,7 +53,7 @@ public class ChangeUserScreenTests
|
||||
if (i < 4) users += ",";
|
||||
}
|
||||
const int currentUser = 2;
|
||||
string fiveUsers = $"{{\"version\":1027,\"users\":[{users}],\"currentUser\":{currentUser},\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}";
|
||||
string fiveUsers = $"{{\"version\":1537,\"users\":[{users}],\"currentUser\":{currentUser},\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}";
|
||||
|
||||
File.WriteAllText(path, fiveUsers);
|
||||
PersistentDataController.PATH = path;
|
||||
@@ -132,7 +132,7 @@ public class ChangeUserScreenTests
|
||||
Assert.AreEqual(UserList.GetUsers().Count, cards.Count);
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public class ChangeUserScreenTests
|
||||
// Before update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ public class ChangeUserScreenTests
|
||||
// After update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class ChangeUserScreenTests
|
||||
// Before update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class ChangeUserScreenTests
|
||||
// After update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public class ChangeUserScreenTests
|
||||
// Before update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ public class ChangeUserScreenTests
|
||||
// After update
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, cards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public class ChangeUserScreenTests
|
||||
var oldCards = GameObject.FindObjectsOfType<UserCard>().ToList();
|
||||
for (int i = 0; i < oldCards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ public class ChangeUserScreenTests
|
||||
Assert.AreEqual(oldCards.Count - 1, newCards.Count);
|
||||
for (int i = 0; i < newCards.Count; i++)
|
||||
{
|
||||
Color expected = i == (currentUser - 1) ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == (currentUser - 1) ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, newCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class ChangeUserScreenTests
|
||||
var oldCards = GameObject.FindObjectsOfType<UserCard>().ToList();
|
||||
for (int i = 0; i < oldCards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public class ChangeUserScreenTests
|
||||
Assert.AreEqual(oldCards.Count - 1, newCards.Count);
|
||||
for (int i = 0; i < newCards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, newCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
@@ -333,7 +333,7 @@ public class ChangeUserScreenTests
|
||||
var oldCards = GameObject.FindObjectsOfType<UserCard>().ToList();
|
||||
for (int i = 0; i < oldCards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ public class ChangeUserScreenTests
|
||||
Assert.AreEqual(oldCards.Count - 1, newCards.Count);
|
||||
for (int i = 0; i < newCards.Count; i++)
|
||||
{
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray;
|
||||
Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f);
|
||||
Assert.AreEqual(expected, newCards[i].gameObject.GetComponent<Image>().color);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user