Skip to content

Commit 4b15977

Browse files
committed
Added testing
1 parent 63d315a commit 4b15977

18 files changed

+650
-0
lines changed

Assets/Kekser/Tests.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Kekser.PowerSingleton.Attributes;
2+
using UnityEngine;
3+
4+
namespace Kekser.Tests
5+
{
6+
[PowerSingleton(Creation = PowerSingletonCreation.Always, CreationName = "AlwaysSingleton")]
7+
public class AlwaysSingleton : MonoBehaviour
8+
{
9+
public static bool Created = false;
10+
11+
private void Awake()
12+
{
13+
Created = true;
14+
}
15+
16+
private void OnDestroy()
17+
{
18+
Created = false;
19+
}
20+
}
21+
}

Assets/Kekser/Tests/AlwaysSingleton.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Kekser.PowerSingleton.Attributes;
2+
using UnityEngine;
3+
4+
namespace Kekser.Tests
5+
{
6+
[PowerSingleton]
7+
public class DefaultSingleton : MonoBehaviour
8+
{
9+
public static bool Created = false;
10+
11+
private void Awake()
12+
{
13+
Created = true;
14+
}
15+
16+
private void OnDestroy()
17+
{
18+
Created = false;
19+
}
20+
}
21+
}

Assets/Kekser/Tests/DefaultSingleton.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Kekser.Tests
2+
{
3+
public interface IInterfaceSingleton
4+
{
5+
6+
}
7+
}

Assets/Kekser/Tests/IInterfaceSingleton.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Kekser.PowerSingleton.Attributes;
2+
using UnityEngine;
3+
4+
namespace Kekser.Tests
5+
{
6+
[PowerSingleton(Creation = PowerSingletonCreation.IfNeeded, CreationName = "IfNeededSingleton")]
7+
public class IfNeededSingleton : MonoBehaviour
8+
{
9+
public static bool Created = false;
10+
11+
private void Awake()
12+
{
13+
Created = true;
14+
}
15+
16+
private void OnDestroy()
17+
{
18+
Created = false;
19+
}
20+
}
21+
}

Assets/Kekser/Tests/IfNeededSingleton.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Kekser.PowerSingleton.Attributes;
2+
using UnityEngine;
3+
4+
namespace Kekser.Tests
5+
{
6+
[PowerSingleton(typeof(IInterfaceSingleton))]
7+
public class InterfaceSingleton : MonoBehaviour, IInterfaceSingleton
8+
{
9+
public static bool Created = false;
10+
11+
private void Awake()
12+
{
13+
Created = true;
14+
}
15+
16+
private void OnDestroy()
17+
{
18+
Created = false;
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)