MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / TestIncName

Method TestIncName

Source/Engine/Tests/TestStringUtils.cs:17–25  ·  view source on GitHub ↗

Test incrementing name numbers.

()

Source from the content-addressed store, hash-verified

15 /// Test incrementing name numbers.
16 /// </summary>
17 [Test]
18 public void TestIncName()
19 {
20 Assert.AreEqual("my Name", FlaxEditor.Utilities.Utils.IncrementNameNumber("my Name", null));
21 Assert.AreEqual("my Name", FlaxEditor.Utilities.Utils.IncrementNameNumber("my Name", x => true));
22 Assert.AreEqual("my Name 10", FlaxEditor.Utilities.Utils.IncrementNameNumber("my Name 1", x => x.EndsWith("10")));
23 Assert.AreEqual("my Name (10)", FlaxEditor.Utilities.Utils.IncrementNameNumber("my Name (1)", x => x.EndsWith("10)")));
24 Assert.AreEqual("my Name110", FlaxEditor.Utilities.Utils.IncrementNameNumber("my Name100", x => x.EndsWith("110")));
25 }
26 }
27}
28#endif

Callers

nothing calls this directly

Calls 3

IncrementNameNumberMethod · 0.80
AreEqualMethod · 0.45
EndsWithMethod · 0.45

Tested by

no test coverage detected