chore: migrate tests from public to internal (#2930)

* changing all test public api to internal

* updating changelog

* additional changes

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
This commit is contained in:
Frank Luong 2024-05-22 16:40:23 -04:00 коммит произвёл GitHub
Родитель 6a4bb8f68a
Коммит 0060d33cf0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
118 изменённых файлов: 234 добавлений и 234 удалений

Просмотреть файл

@ -22,9 +22,9 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Changed
- Change all the access modifiers of test class from Public to Internal (#2930)
- Changed messages are now sorted by enum values as opposed to ordinally sorting the messages by their type name. (#2929)
## [2.0.0-exp.2] - 2024-04-02
### Added

Просмотреть файл

@ -2,7 +2,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class ArithmeticTests
internal class ArithmeticTests
{
[Test]
public void TestCeil()

Просмотреть файл

@ -8,7 +8,7 @@ using UnityEngine;
namespace Unity.Netcode.EditorTests
{
public class BuildTests
internal class BuildTests
{
public const string DefaultBuildScenePath = "Tests/Editor/Build/BuildTestScene.unity";

Просмотреть файл

@ -3,7 +3,7 @@ using Unity.Collections;
namespace Unity.Netcode.EditorTests
{
public class DisconnectMessageTests
internal class DisconnectMessageTests
{
[Test]
public void EmptyDisconnectReason()

Просмотреть файл

@ -3,7 +3,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class InterpolatorTests
internal class InterpolatorTests
{
private const float k_Precision = 0.00000001f;
private const int k_MockTickRate = 1;

Просмотреть файл

@ -3,7 +3,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class DisconnectOnSendTests
internal class DisconnectOnSendTests
{
private struct TestMessage : INetworkMessage, INetworkSerializeByMemcpy
{

Просмотреть файл

@ -10,7 +10,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.EditorTests
{
public class MessageCorruptionTests
internal class MessageCorruptionTests
{
private struct TestMessage : INetworkMessage, INetworkSerializeByMemcpy

Просмотреть файл

@ -7,7 +7,7 @@ using Unity.Collections.LowLevel.Unsafe;
namespace Unity.Netcode.EditorTests
{
public class MessageReceivingTests
internal class MessageReceivingTests
{
private struct TestMessage : INetworkMessage, INetworkSerializeByMemcpy
{

Просмотреть файл

@ -3,7 +3,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class MessageRegistrationTests
internal class MessageRegistrationTests
{
private struct TestMessageOne : INetworkMessage, INetworkSerializeByMemcpy
{

Просмотреть файл

@ -10,7 +10,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class MessageSendingTests
internal class MessageSendingTests
{
private struct TestMessage : INetworkMessage, INetworkSerializeByMemcpy
{

Просмотреть файл

@ -5,7 +5,7 @@ using NUnit.Framework.Internal;
namespace Unity.Netcode.EditorTests
{
public class MessageVersioningTests
internal class MessageVersioningTests
{
public static int SentVersion;
public static int ReceivedVersion;

Просмотреть файл

@ -8,7 +8,7 @@ using Unity.Multiplayer.Tools.NetStats;
namespace Unity.Netcode.EditorTests.Metrics
{
public class NetworkMetricsRegistrationTests
internal class NetworkMetricsRegistrationTests
{
private static Type[] s_MetricTypes = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(x => x.GetTypes())

Просмотреть файл

@ -4,7 +4,7 @@ using Object = UnityEngine.Object;
namespace Unity.Netcode.EditorTests
{
public class NetworkBehaviourTests
internal class NetworkBehaviourTests
{
[Test]
public void HasNetworkObjectTest()
@ -66,12 +66,12 @@ namespace Unity.Netcode.EditorTests
// Note: in order to repro https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/1078
// this child class must be defined before its parent to assure it is processed first by ILPP
public class DerivedNetworkBehaviour : EmptyNetworkBehaviour
internal class DerivedNetworkBehaviour : EmptyNetworkBehaviour
{
}
public class EmptyNetworkBehaviour : NetworkBehaviour
internal class EmptyNetworkBehaviour : NetworkBehaviour
{
}

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.EditorTests
{
public class NetworkManagerConfigurationTests
internal class NetworkManagerConfigurationTests
{
[SetUp]
public void OnSetup()

Просмотреть файл

@ -6,7 +6,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.EditorTests
{
public class NetworkObjectTests
internal class NetworkObjectTests
{
[Test]
public void NetworkManagerOverrideTest()
@ -146,12 +146,12 @@ namespace Unity.Netcode.EditorTests
public int NetworkBehaviourIndex;
}
public class EmptyNetworkBehaviour : NetworkBehaviour
internal class EmptyNetworkBehaviour : NetworkBehaviour
{
}
public class EmptyMonoBehaviour : MonoBehaviour
internal class EmptyMonoBehaviour : MonoBehaviour
{
}

Просмотреть файл

@ -5,7 +5,7 @@ using UnityEngine;
namespace Unity.Netcode.EditorTests
{
public class NetworkPrefabProcessorTests
internal class NetworkPrefabProcessorTests
{
private NetcodeForGameObjectsProjectSettings m_Settings;
private bool m_EditorDefaultPrefabSetting;

Просмотреть файл

@ -3,9 +3,9 @@ using UnityEngine;
namespace Unity.Netcode.EditorTests.NetworkVar
{
public class NetworkVarTests
internal class NetworkVarTests
{
public class NetworkVarComponent : NetworkBehaviour
internal class NetworkVarComponent : NetworkBehaviour
{
public NetworkVariable<int> NetworkVariable = new NetworkVariable<int>();
}

Просмотреть файл

@ -6,7 +6,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public abstract class BaseFastBufferReaderWriterTest
internal abstract class BaseFastBufferReaderWriterTest
{
protected enum ByteEnum : byte
{

Просмотреть файл

@ -2,7 +2,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class BitCounterTests
internal class BitCounterTests
{
[Test]
public void WhenCountingUsedBitsIn64BitValue_ResultMatchesHighBitSetPlusOne([Range(0, 63)] int highBit)

Просмотреть файл

@ -4,7 +4,7 @@ using Unity.Collections;
namespace Unity.Netcode.EditorTests
{
public class BitReaderTests
internal class BitReaderTests
{
[Test]
public void TestReadingOneBit()

Просмотреть файл

@ -4,7 +4,7 @@ using Unity.Collections;
namespace Unity.Netcode.EditorTests
{
public class BitWriterTests
internal class BitWriterTests
{
[Test]
public unsafe void TestWritingOneBit()

Просмотреть файл

@ -5,7 +5,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class BufferSerializerTests
internal class BufferSerializerTests
{
[Test]
public void TestIsReaderIsWriter()

Просмотреть файл

@ -8,7 +8,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class BytePackerTests
internal class BytePackerTests
{
private enum ByteEnum : byte
{

Просмотреть файл

@ -7,7 +7,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class FastBufferReaderTests : BaseFastBufferReaderWriterTest
internal class FastBufferReaderTests : BaseFastBufferReaderWriterTest
{
private void WriteCheckBytes(FastBufferWriter writer, int writeSize, string failMessage = "")
{

Просмотреть файл

@ -8,7 +8,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class FastBufferWriterTests : BaseFastBufferReaderWriterTest
internal class FastBufferWriterTests : BaseFastBufferReaderWriterTest
{
private void WriteCheckBytes(FastBufferWriter writer, int writeSize, string failMessage = "")
{

Просмотреть файл

@ -3,7 +3,7 @@ using Unity.Collections;
namespace Unity.Netcode.EditorTests
{
public class UserBitReaderAndBitWriterTests_NCCBUG175
internal class UserBitReaderAndBitWriterTests_NCCBUG175
{
[Test]

Просмотреть файл

@ -7,7 +7,7 @@ namespace Unity.Netcode.EditorTests
/// <summary>
/// Tests for running a <see cref="NetworkTimeSystem"/> as a client.
/// </summary>
public class ClientNetworkTimeSystemTests
internal class ClientNetworkTimeSystemTests
{
private const double k_AcceptableRttOffset = 0.03d; // 30ms offset is fine

Просмотреть файл

@ -7,7 +7,7 @@ using Random = System.Random;
namespace Unity.Netcode.EditorTests
{
public class NetworkTimeTests
internal class NetworkTimeTests
{
[Test]
[TestCase(0d, 0u)]

Просмотреть файл

@ -3,7 +3,7 @@ using UnityEngine;
namespace Unity.Netcode.EditorTests
{
public class ServerNetworkTimeSystemTests
internal class ServerNetworkTimeSystemTests
{
/// <summary>

Просмотреть файл

@ -7,7 +7,7 @@ namespace Unity.Netcode.EditorTests
/// <summary>
/// Helper functions for timing related tests. Allows to get a set of time steps and simulate time advancing without the need of a full playmode test.
/// </summary>
public static class TimingTestHelper
internal static class TimingTestHelper
{
public static List<float> GetRandomTimeSteps(float totalDuration, float min, float max, int seed)
{

Просмотреть файл

@ -8,7 +8,7 @@ using Unity.Networking.Transport;
namespace Unity.Netcode.EditorTests
{
public class BatchedReceiveQueueTests
internal class BatchedReceiveQueueTests
{
[Test]
public void BatchedReceiveQueue_EmptyReader()

Просмотреть файл

@ -8,7 +8,7 @@ using Unity.Networking.Transport;
namespace Unity.Netcode.EditorTests
{
public class BatchedSendQueueTests
internal class BatchedSendQueueTests
{
private const int k_TestQueueCapacity = 16 * 1024;
private const int k_TestMessageSize = 1020;

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.EditorTests
{
public class UNetTransportTests
internal class UNetTransportTests
{
[Test]
public void StartServerReturnsFalseOnFailure()

Просмотреть файл

@ -5,7 +5,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.EditorTests
{
public class UnityTransportTests
internal class UnityTransportTests
{
[SetUp]
public void OnSetup()

Просмотреть файл

@ -2,7 +2,7 @@ using NUnit.Framework;
namespace Unity.Netcode.EditorTests
{
public class XXHashTests
internal class XXHashTests
{
[Test]
public void TestXXHash32Short()

Просмотреть файл

@ -7,9 +7,9 @@ using Object = UnityEngine.Object;
namespace Unity.Netcode.RuntimeTests
{
public class AddNetworkPrefabTest : NetcodeIntegrationTest
internal class AddNetworkPrefabTest : NetcodeIntegrationTest
{
public class EmptyComponent : NetworkBehaviour
internal class EmptyComponent : NetworkBehaviour
{
}

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class ClientApprovalDenied : NetcodeIntegrationTest
internal class ClientApprovalDenied : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;
private bool m_ApproveConnection = true;

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class ClientOnlyConnectionTests
internal class ClientOnlyConnectionTests
{
private NetworkManager m_ClientNetworkManager;
private GameObject m_NetworkManagerGameObject;

Просмотреть файл

@ -9,7 +9,7 @@ namespace Unity.Netcode.RuntimeTests
/// - Sending and Receiving a continually growing buffer up to (MaximumBufferSize)
/// - Default maximum buffer size is 1MB
/// </summary>
public class BufferDataValidationComponent : NetworkBehaviour
internal class BufferDataValidationComponent : NetworkBehaviour
{
/// <summary>
/// Allows the external RPCQueueTest to begin testing or stop it

Просмотреть файл

@ -6,7 +6,7 @@ using UnityEngine;
namespace Unity.Netcode.RuntimeTests
{
public class EmbeddedManagedNetworkSerializableType : INetworkSerializable
internal class EmbeddedManagedNetworkSerializableType : INetworkSerializable
{
public int Int;
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
@ -14,7 +14,7 @@ namespace Unity.Netcode.RuntimeTests
serializer.SerializeValue(ref Int);
}
}
public class ManagedNetworkSerializableType : INetworkSerializable, IEquatable<ManagedNetworkSerializableType>
internal class ManagedNetworkSerializableType : INetworkSerializable, IEquatable<ManagedNetworkSerializableType>
{
public string Str = "";
public int[] Ints = Array.Empty<int>();
@ -104,7 +104,7 @@ namespace Unity.Netcode.RuntimeTests
return 0;
}
}
public struct UnmanagedNetworkSerializableType : INetworkSerializable, IEquatable<UnmanagedNetworkSerializableType>
internal struct UnmanagedNetworkSerializableType : INetworkSerializable, IEquatable<UnmanagedNetworkSerializableType>
{
public FixedString32Bytes Str;
public int Int;
@ -143,7 +143,7 @@ namespace Unity.Netcode.RuntimeTests
}
public struct UnmanagedTemplateNetworkSerializableType<T> : INetworkSerializable where T : unmanaged, INetworkSerializable
internal struct UnmanagedTemplateNetworkSerializableType<T> : INetworkSerializable where T : unmanaged, INetworkSerializable
{
public T Value;
@ -153,7 +153,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct ManagedTemplateNetworkSerializableType<T> : INetworkSerializable where T : class, INetworkSerializable, new()
internal struct ManagedTemplateNetworkSerializableType<T> : INetworkSerializable where T : class, INetworkSerializable, new()
{
public T Value;

Просмотреть файл

@ -1,6 +1,6 @@
namespace Unity.Netcode.RuntimeTests
{
public class NetworkVisibilityComponent : NetworkBehaviour
internal class NetworkVisibilityComponent : NetworkBehaviour
{
public void Hide()
{

Просмотреть файл

@ -8,7 +8,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class ConnectionApprovalTests
internal class ConnectionApprovalTests
{
private Guid m_ValidationToken;
private bool m_IsValidated;

Просмотреть файл

@ -9,7 +9,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(ApprovalTimedOutTypes.ServerDoesNotRespond)]
[TestFixture(ApprovalTimedOutTypes.ClientDoesNotRequest)]
public class ConnectionApprovalTimeoutTests : NetcodeIntegrationTest
internal class ConnectionApprovalTimeoutTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -116,7 +116,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class DeferredMessageTestRpcComponent : NetworkBehaviour
internal class DeferredMessageTestRpcComponent : NetworkBehaviour
{
public bool ClientRpcCalled;
@ -137,7 +137,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class DeferredMessageTestNetworkVariableComponent : NetworkBehaviour
internal class DeferredMessageTestNetworkVariableComponent : NetworkBehaviour
{
public static readonly List<ulong> ClientInstances = new List<ulong>();
@ -158,7 +158,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class DeferredMessageTestRpcAndNetworkVariableComponent : NetworkBehaviour
internal class DeferredMessageTestRpcAndNetworkVariableComponent : NetworkBehaviour
{
public static readonly List<ulong> ClientInstances = new List<ulong>();
public bool ClientRpcCalled;
@ -185,7 +185,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class DeferredMessagingTest : NetcodeIntegrationTest
internal class DeferredMessagingTest : NetcodeIntegrationTest
{
protected override int NumberOfClients => 0;

Просмотреть файл

@ -21,7 +21,7 @@ namespace Unity.Netcode.RuntimeTests
/// </summary>
[TestFixture(OwnerPersistence.DestroyWithOwner)]
[TestFixture(OwnerPersistence.DontDestroyWithOwner)]
public class DisconnectTests : NetcodeIntegrationTest
internal class DisconnectTests : NetcodeIntegrationTest
{
public enum OwnerPersistence
{

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class DeferredDespawningTests : IntegrationTestWithApproximation
internal class DeferredDespawningTests : IntegrationTestWithApproximation
{
private const int k_DaisyChainedCount = 5;
protected override int NumberOfClients => 2;
@ -85,7 +85,7 @@ namespace Unity.Netcode.RuntimeTests
/// prefab driven by the authority. This repeats for the number specified in the integration
/// test.
/// </summary>
public class DeferredDespawnDaisyChained : NetworkBehaviour
internal class DeferredDespawnDaisyChained : NetworkBehaviour
{
public static bool EnableVerbose;
public static Action<ulong> ReachedLastChainInstance;

Просмотреть файл

@ -17,7 +17,7 @@ namespace Unity.Netcode.RuntimeTests
/// Validates that distributable NetworkObjects are distributed upon
/// a client connecting or disconnecting.
/// </summary>
public class DistributeObjectsTests : IntegrationTestWithApproximation
internal class DistributeObjectsTests : IntegrationTestWithApproximation
{
private GameObject m_DistributeObject;
@ -352,7 +352,7 @@ namespace Unity.Netcode.RuntimeTests
/// This keeps track of each clients perspective of which NetworkObjects are owned by which client.
/// It is used to validate that all clients are in synch with ownership updates.
/// </summary>
public class DistributeObjectsTestHelper : NetworkBehaviour
internal class DistributeObjectsTestHelper : NetworkBehaviour
{
/// <summary>
/// [Client Context][Client Owners][NetworkObjectId][NetworkObject]
@ -426,7 +426,7 @@ namespace Unity.Netcode.RuntimeTests
/// This is used to validate that upon distributed ownership changes NetworkTransform sycnhronization
/// still works properly.
/// </summary>
public class DistributeTestTransform : NetworkTransform
internal class DistributeTestTransform : NetworkTransform
{
private float m_DeltaVarPosition = 0.15f;
private float m_DeltaVarQauternion = 0.015f;

Просмотреть файл

@ -16,7 +16,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class DistributedAuthorityCodecTests : NetcodeIntegrationTest
internal class DistributedAuthorityCodecTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;
@ -35,7 +35,7 @@ namespace Unity.Netcode.RuntimeTests
private GameObject m_SpawnObject;
public class TestNetworkComponent : NetworkBehaviour
internal class TestNetworkComponent : NetworkBehaviour
{
public NetworkList<int> MyNetworkList = new NetworkList<int>(new List<int> { 1, 2, 3 });

Просмотреть файл

@ -14,7 +14,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
[TestFixture(HostOrServer.DAHost)]
public class NetworkClientAndPlayerObjectTests : NetcodeIntegrationTest
internal class NetworkClientAndPlayerObjectTests : NetcodeIntegrationTest
{
private const int k_PlayerPrefabCount = 6;
protected override int NumberOfClients => 2;
@ -168,7 +168,7 @@ namespace Unity.Netcode.RuntimeTests
[UnityTest]
public IEnumerator ValidateNetworkClients()
{
// Validate the initial clients created
// Validate the initial clients created
yield return WaitForConditionOrTimeOut(AllNetworkClientsValidated);
AssertOnTimeout($"[Start] Not all NetworkClients were valid!\n{m_ErrorLogLevel1}");
@ -190,7 +190,7 @@ namespace Unity.Netcode.RuntimeTests
}
/// <summary>
/// Verify that all NetworkClients are pointing to the correct player object, even if
/// Verify that all NetworkClients are pointing to the correct player object, even if
/// the player object is changed.
/// </summary>
private bool ValidatePlayerObjectOnClients(NetworkManager clientToValidate)

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class OwnershipPermissionsTests : IntegrationTestWithApproximation
internal class OwnershipPermissionsTests : IntegrationTestWithApproximation
{
private GameObject m_PermissionsObject;
@ -332,7 +332,7 @@ namespace Unity.Netcode.RuntimeTests
AssertOnTimeout($"[Targeted Owner] Client-{daHostInstance.NetworkManager.LocalClientId} did not get the right request reponse: {daHostInstanceHelper.OwnershipRequestResponseStatus} Expecting: {NetworkObject.OwnershipRequestResponseStatus.Approved}!");
}
public class OwnershipPermissionsTestHelper : NetworkBehaviour
internal class OwnershipPermissionsTestHelper : NetworkBehaviour
{
public static NetworkObject CurrentOwnedInstance;

Просмотреть файл

@ -7,11 +7,11 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class HiddenVariableTest : NetworkBehaviour
internal class HiddenVariableTest : NetworkBehaviour
{
}
public class HiddenVariableObject : NetworkBehaviour
internal class HiddenVariableObject : NetworkBehaviour
{
public static List<NetworkObject> ClientInstancesSpawned = new List<NetworkObject>();
@ -69,7 +69,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class HiddenVariableTests : NetcodeIntegrationTest
internal class HiddenVariableTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 4;

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class IntegrationTestUpdated : NetcodeIntegrationTest
internal class IntegrationTestUpdated : NetcodeIntegrationTest
{
private GameObject m_MyNetworkPrefab;
protected override int NumberOfClients => 1;
@ -45,7 +45,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class IntegrationTestExtended : NetcodeIntegrationTest
internal class IntegrationTestExtended : NetcodeIntegrationTest
{
private GameObject m_MyNetworkPrefab;
protected override int NumberOfClients => 1;
@ -84,11 +84,11 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class ExampleTestComponent : NetworkBehaviour
internal class ExampleTestComponent : NetworkBehaviour
{
}
public class IntegrationTestPlayers : NetcodeIntegrationTest
internal class IntegrationTestPlayers : NetcodeIntegrationTest
{
protected override int NumberOfClients => 5;
@ -126,13 +126,13 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class SpawnTest : NetworkBehaviour
internal class SpawnTest : NetworkBehaviour
{
public static int TotalSpawned;
public override void OnNetworkSpawn() { TotalSpawned++; }
public override void OnNetworkDespawn() { TotalSpawned--; }
}
public class IntegrationTestSpawning : NetcodeIntegrationTest
internal class IntegrationTestSpawning : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;
private GameObject m_NetworkPrefabToSpawn;

Просмотреть файл

@ -12,7 +12,7 @@ using Debug = UnityEngine.Debug;
namespace Unity.Netcode.RuntimeTests
{
public class InvalidConnectionEventsTest : NetcodeIntegrationTest
internal class InvalidConnectionEventsTest : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -6,12 +6,12 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkListChangedTestComponent : NetworkBehaviour
internal class NetworkListChangedTestComponent : NetworkBehaviour
{
}
public class ListChangedObject : NetworkBehaviour
internal class ListChangedObject : NetworkBehaviour
{
public int ExpectedPreviousValue = 0;
public int ExpectedValue = 0;
@ -48,7 +48,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(SessionModeTypes.DistributedAuthority)]
[TestFixture(SessionModeTypes.ClientServer)]
public class NetworkListChangedTests : NetcodeIntegrationTest
internal class NetworkListChangedTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -8,12 +8,12 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class DisconnectReasonObject : NetworkBehaviour
internal class DisconnectReasonObject : NetworkBehaviour
{
}
public class DisconnectReasonTests : NetcodeIntegrationTest
internal class DisconnectReasonTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -8,7 +8,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NamedMessageTests : NetcodeIntegrationTest
internal class NamedMessageTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -8,7 +8,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class UnnamedMessageTests : NetcodeIntegrationTest
internal class UnnamedMessageTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -14,7 +14,7 @@ namespace Unity.Netcode.RuntimeTests.Metrics
[TestFixture(ClientCount.TwoClients, HostOrServer.Host)]
[TestFixture(ClientCount.OneClient, HostOrServer.Server)]
[TestFixture(ClientCount.TwoClients, HostOrServer.Server)]
public class ConnectionMetricsTests : NetcodeIntegrationTest
internal class ConnectionMetricsTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => m_ClientCount;

Просмотреть файл

@ -12,7 +12,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests.Metrics
{
public class MessagingMetricsTests : DualClientMetricTestBase
internal class MessagingMetricsTests : DualClientMetricTestBase
{
private const uint k_MessageNameHashSize = 8;
// Header is dynamically sized due to packing, will be 2 bytes for all test messages.

Просмотреть файл

@ -8,7 +8,7 @@ using Unity.Netcode.TestHelpers.Runtime;
namespace Unity.Netcode.RuntimeTests.Metrics
{
public class MetricsDispatchTests
internal class MetricsDispatchTests
{
private int m_NbDispatches;

Просмотреть файл

@ -15,7 +15,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests.Metrics
{
public class PacketLossMetricsTests : NetcodeIntegrationTest
internal class PacketLossMetricsTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;
private readonly int m_PacketLossRate = 25;

Просмотреть файл

@ -6,7 +6,7 @@ using Object = UnityEngine.Object;
namespace Unity.Netcode.RuntimeTests
{
public class NestedNetworkManagerTests
internal class NestedNetworkManagerTests
{
[Test]
public void CheckNestedNetworkManager()

Просмотреть файл

@ -10,7 +10,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// This class is for testing general fixes or functionality of NetworkBehaviours
/// </summary>
public class NetworkBehaviourGenericTests : NetcodeIntegrationTest
internal class NetworkBehaviourGenericTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 0;
@ -21,7 +21,7 @@ namespace Unity.Netcode.RuntimeTests
return m_AllowServerToStart;
}
public class SimpleNetworkBehaviour : NetworkBehaviour
internal class SimpleNetworkBehaviour : NetworkBehaviour
{
public bool OnNetworkDespawnCalled;

Просмотреть файл

@ -8,7 +8,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.DAHost)]
public class NetworkBehaviourPrePostSpawnTests : NetcodeIntegrationTest
internal class NetworkBehaviourPrePostSpawnTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 0;
@ -27,7 +27,7 @@ namespace Unity.Netcode.RuntimeTests
base.OnServerAndClientsCreated();
}
public class NetworkBehaviourPreSpawn : NetworkBehaviour
internal class NetworkBehaviourPreSpawn : NetworkBehaviour
{
public static int ValueToSet;
public bool OnNetworkPreSpawnCalled;
@ -55,7 +55,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class NetworkBehaviourPostSpawn : NetworkBehaviour
internal class NetworkBehaviourPostSpawn : NetworkBehaviour
{
public bool OnNetworkPostSpawnCalled;

Просмотреть файл

@ -12,7 +12,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// This is a refactor of the original test's NetworkBehaviour INetVarInfo derived NetworkBehaviours
/// </summary>
public class NetVarContainer : NetworkBehaviour
internal class NetVarContainer : NetworkBehaviour
{
public enum NetVarsToCheck
{
@ -126,7 +126,7 @@ namespace Unity.Netcode.RuntimeTests
/// Used to define how many NetworkVariables to use per NetVarContainer instance.
/// There are always two
/// </summary>
public struct NetVarCombinationTypes
internal struct NetVarCombinationTypes
{
public NetVarContainer.NetVarsToCheck FirstType;
public NetVarContainer.NetVarsToCheck SecondType;
@ -157,7 +157,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.Host, 2, NetVarContainer.NetVarsToCheck.One, NetVarContainer.NetVarsToCheck.One)]
[TestFixture(HostOrServer.Host, 2, NetVarContainer.NetVarsToCheck.One, NetVarContainer.NetVarsToCheck.Two)]
[TestFixture(HostOrServer.Host, 2, NetVarContainer.NetVarsToCheck.Two, NetVarContainer.NetVarsToCheck.Two)]
public class NetworkBehaviourUpdaterTests : NetcodeIntegrationTest
internal class NetworkBehaviourUpdaterTests : NetcodeIntegrationTest
{
// Go ahead and create maximum number of clients (not all tests will use them)
protected override int NumberOfClients => m_NumberOfClients;

Просмотреть файл

@ -3,7 +3,7 @@ using UnityEngine;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkManagerCustomMessageManagerTests
internal class NetworkManagerCustomMessageManagerTests
{
[Test]
public void CustomMessageManagerAssigned()

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkManagerEventsTests
internal class NetworkManagerEventsTests
{
private NetworkManager m_ClientManager;
private NetworkManager m_ServerManager;

Просмотреть файл

@ -3,7 +3,7 @@ using UnityEngine;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkManagerSceneManagerTests
internal class NetworkManagerSceneManagerTests
{
[Test]
public void SceneManagerAssigned()

Просмотреть файл

@ -6,7 +6,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkManagerTransportTests
internal class NetworkManagerTransportTests
{
[Test]
public void ClientDoesNotStartWhenTransportFails()
@ -106,7 +106,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// Does nothing but simulate a transport that can fail at startup and/or when polling events.
/// </summary>
public class FailedTransport : TestingNetworkTransport
internal class FailedTransport : TestingNetworkTransport
{
public bool FailOnStart = false;
public bool FailOnNextPoll = false;

Просмотреть файл

@ -16,7 +16,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(SessionModeTypes.DistributedAuthority)]
[TestFixture(SessionModeTypes.ClientServer)]
public class NetworkObjectDestroyTests : NetcodeIntegrationTest
internal class NetworkObjectDestroyTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;
@ -96,7 +96,7 @@ namespace Unity.Netcode.RuntimeTests
}
else
{
// Shutdown the
// Shutdown the
m_ClientNetworkManagers[0].Shutdown();
}
}

Просмотреть файл

@ -11,7 +11,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class NetworkObjectDontDestroyWithOwnerTests : NetcodeIntegrationTest
internal class NetworkObjectDontDestroyWithOwnerTests : NetcodeIntegrationTest
{
private const int k_NumberObjectsToSpawn = 32;
protected override int NumberOfClients => 1;

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkObjectNetworkClientOwnedObjectsTests : NetcodeIntegrationTest
internal class NetworkObjectNetworkClientOwnedObjectsTests : NetcodeIntegrationTest
{
private class DummyNetworkBehaviour : NetworkBehaviour
{

Просмотреть файл

@ -13,7 +13,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class NetworkObjectOnNetworkDespawnTests : NetcodeIntegrationTest
internal class NetworkObjectOnNetworkDespawnTests : NetcodeIntegrationTest
{
private const string k_ObjectName = "TestDespawn";
public enum InstanceTypes

Просмотреть файл

@ -9,7 +9,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(SessionModeTypes.DistributedAuthority)]
[TestFixture(SessionModeTypes.ClientServer)]
public class NetworkObjectOnSpawnTests : NetcodeIntegrationTest
internal class NetworkObjectOnSpawnTests : NetcodeIntegrationTest
{
private GameObject m_TestNetworkObjectPrefab;
private GameObject m_TestNetworkObjectInstance;
@ -43,7 +43,7 @@ namespace Unity.Netcode.RuntimeTests
{
if (m_ObserverTestType == ObserverTestTypes.WithObservers)
{
// When validating this portion of the test and spawning with observers is true, there
// When validating this portion of the test and spawning with observers is true, there
// should be spawned objects on the clients.
if (!s_GlobalNetworkObjects.ContainsKey(client.LocalClientId))
{
@ -52,7 +52,7 @@ namespace Unity.Netcode.RuntimeTests
}
else
{
// When validating this portion of the test and spawning with observers is false, there
// When validating this portion of the test and spawning with observers is false, there
// should be no spawned objects on the clients.
if (s_GlobalNetworkObjects.ContainsKey(client.LocalClientId))
{

Просмотреть файл

@ -10,7 +10,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(SessionModeTypes.DistributedAuthority)]
[TestFixture(SessionModeTypes.ClientServer)]
public class NetworkObjectOwnershipPropertiesTests : NetcodeIntegrationTest
internal class NetworkObjectOwnershipPropertiesTests : NetcodeIntegrationTest
{
private class DummyNetworkBehaviour : NetworkBehaviour
{
@ -186,7 +186,7 @@ namespace Unity.Netcode.RuntimeTests
yield return WaitForMessageReceived<ChangeOwnershipMessage>(m_ClientNetworkManagers.ToList());
}
// Ensure it's the ownership tables are updated
// Ensure it's the ownership tables are updated
yield return WaitForConditionOrTimeOut(OwnershipPropagated);
AssertOnTimeout($"Timed out waiting for ownership to propagate!\n{m_OwnershipPropagatedFailures}");

Просмотреть файл

@ -8,7 +8,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkObjectOwnershipComponent : NetworkBehaviour
internal class NetworkObjectOwnershipComponent : NetworkBehaviour
{
public static Dictionary<ulong, NetworkObjectOwnershipComponent> SpawnedInstances = new Dictionary<ulong, NetworkObjectOwnershipComponent>();
@ -45,7 +45,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class NetworkObjectOwnershipTests : NetcodeIntegrationTest
internal class NetworkObjectOwnershipTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 9;

Просмотреть файл

@ -7,7 +7,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// Tests properties of NetworkObject for proper functionality.
/// </summary>
public class NetworkObjectPropertyTests : NetcodeIntegrationTest
internal class NetworkObjectPropertyTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -9,7 +9,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(SessionModeTypes.ClientServer)]
[TestFixture(SessionModeTypes.DistributedAuthority)]
public class NetworkObjectSpawnManyObjectsTests : NetcodeIntegrationTest
internal class NetworkObjectSpawnManyObjectsTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;
// "many" in this case means enough to exceed a ushort_max message size written in the header
@ -20,7 +20,7 @@ namespace Unity.Netcode.RuntimeTests
public NetworkObjectSpawnManyObjectsTests(SessionModeTypes sessionModeType) : base(sessionModeType) { }
// Using this component assures we will know precisely how many prefabs were spawned on the client
public class SpawnObjecTrackingComponent : NetworkBehaviour
internal class SpawnObjecTrackingComponent : NetworkBehaviour
{
public static int SpawnedObjects;
public override void OnNetworkSpawn()

Просмотреть файл

@ -14,7 +14,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(VariableLengthSafety.EnabledNetVarSafety, HostOrServer.Host)]
[TestFixture(VariableLengthSafety.DisableNetVarSafety, HostOrServer.Server)]
[TestFixture(VariableLengthSafety.EnabledNetVarSafety, HostOrServer.Server)]
public class NetworkObjectSynchronizationTests : NetcodeIntegrationTest
internal class NetworkObjectSynchronizationTests : NetcodeIntegrationTest
{
private const int k_NumberToSpawn = 30;
protected override int NumberOfClients => 0;
@ -382,7 +382,7 @@ namespace Unity.Netcode.RuntimeTests
/// the synchronization process will continue (i.e. it will skip over that block
/// of the reader buffer).
/// </summary>
public class NetworkBehaviourWithNetworkVariables : NetworkBehaviour
internal class NetworkBehaviourWithNetworkVariables : NetworkBehaviour
{
public static int ServerSpawnCount { get; internal set; }
public static readonly Dictionary<ulong, int> ClientSpawnCount = new Dictionary<ulong, int>();
@ -442,7 +442,7 @@ namespace Unity.Netcode.RuntimeTests
/// when variable length safety checks are off NetworkVariables still are updated
/// properly.
/// </summary>
public class NetworkBehaviourWithOwnerNetworkVariables : NetworkBehaviour
internal class NetworkBehaviourWithOwnerNetworkVariables : NetworkBehaviour
{
private NetworkVariableWritePermission m_NetworkVariableWritePermission = NetworkVariableWritePermission.Server;
/// <summary>
@ -491,7 +491,7 @@ namespace Unity.Netcode.RuntimeTests
/// and provides a synchronization success version to validate that synchronization
/// will continue if user synchronization code fails.
/// </summary>
public class NetworkBehaviourSynchronizeFailureComponent : NetworkBehaviour
internal class NetworkBehaviourSynchronizeFailureComponent : NetworkBehaviour
{
public static int NumberOfFailureTypes { get; internal set; }
public static int ServerSpawnCount { get; internal set; }
@ -661,11 +661,11 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class NetworkBehaviourOnSynchronizeComponent : NetworkBehaviour
internal class NetworkBehaviourOnSynchronizeComponent : NetworkBehaviour
{
public SomeCustomSerializationData CustomSerializationData = new SomeCustomSerializationData();
public struct SomeCustomSerializationData : INetworkSerializable
internal struct SomeCustomSerializationData : INetworkSerializable
{
public uint Value1;
public bool Value2;

Просмотреть файл

@ -14,7 +14,7 @@ namespace Unity.Netcode.RuntimeTests
/// Destroying a newly spawned NetworkObject instance works
/// Removing a INetworkPrefabInstanceHandler is removed and can be verified (very last check)
/// </summary>
public class NetworkPrefabHandlerTests
internal class NetworkPrefabHandlerTests
{
private const string k_TestPrefabObjectName = "NetworkPrefabTestObject";
@ -203,7 +203,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// The Prefab instance handler to use for this test
/// </summary>
public class NetworkPrefaInstanceHandler : INetworkPrefabInstanceHandler
internal class NetworkPrefaInstanceHandler : INetworkPrefabInstanceHandler
{
private NetworkObject m_NetworkObject;

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class ShowHideObject : NetworkBehaviour
internal class ShowHideObject : NetworkBehaviour
{
public static List<ShowHideObject> ClientTargetedNetworkObjects = new List<ShowHideObject>();
public static ulong ClientIdToTarget;
@ -128,7 +128,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(SessionModeTypes.ClientServer)]
[TestFixture(SessionModeTypes.DistributedAuthority)]
public class NetworkShowHideTests : NetcodeIntegrationTest
internal class NetworkShowHideTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 4;

Просмотреть файл

@ -7,7 +7,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
public class NetworkSpawnManagerTests : NetcodeIntegrationTest
internal class NetworkSpawnManagerTests : NetcodeIntegrationTest
{
private ulong serverSideClientId => NetworkManager.ServerClientId;
private ulong clientSideClientId => m_ClientNetworkManagers[0].LocalClientId;

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkTransformBase : IntegrationTestWithApproximation
internal class NetworkTransformBase : IntegrationTestWithApproximation
{
// The number of iterations to change position, rotation, and scale for NetworkTransformMultipleChangesOverTime
@ -731,7 +731,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// Helper component for all NetworkTransformTests
/// </summary>
public class NetworkTransformTestComponent : NetworkTransform
internal class NetworkTransformTestComponent : NetworkTransform
{
public bool ServerAuthority;
public bool ReadyToReceivePositionUpdate = false;
@ -794,7 +794,7 @@ namespace Unity.Netcode.RuntimeTests
/// Helper component for NetworkTransform parenting tests when
/// a child is a parent of another child (i.e. "sub child")
/// </summary>
public class SubChildObjectComponent : ChildObjectComponent
internal class SubChildObjectComponent : ChildObjectComponent
{
protected override bool IsSubChild()
{
@ -805,7 +805,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// Helper component for NetworkTransform parenting tests
/// </summary>
public class ChildObjectComponent : NetworkTransform
internal class ChildObjectComponent : NetworkTransform
{
public static int TestCount;
public static bool EnableChildLog;

Просмотреть файл

@ -6,7 +6,7 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(HostOrServer.Host, Authority.OwnerAuthority)]
[TestFixture(HostOrServer.Host, Authority.ServerAuthority)]
public class NetworkTransformGeneral : NetworkTransformBase
internal class NetworkTransformGeneral : NetworkTransformBase
{
public NetworkTransformGeneral(HostOrServer testWithHost, Authority authority) :
base(testWithHost, authority, RotationCompression.None, Rotation.Euler, Precision.Full)
@ -66,7 +66,7 @@ namespace Unity.Netcode.RuntimeTests
var halfThreshold = m_AuthoritativeTransform.RotAngleThreshold * 0.5001f;
// Apply the current state prior to getting reference rotations which assures we have
// applied the most current rotation deltas and that all bitset flags are updated
// applied the most current rotation deltas and that all bitset flags are updated
var results = m_AuthoritativeTransform.ApplyState();
TimeTravelAdvanceTick();

Просмотреть файл

@ -12,7 +12,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost, MotionModels.UseTransform)]
[TestFixture(HostOrServer.DAHost, MotionModels.UseRigidbody)]
[TestFixture(HostOrServer.Host, MotionModels.UseTransform)]
public class NetworkTransformOwnershipTests : IntegrationTestWithApproximation
internal class NetworkTransformOwnershipTests : IntegrationTestWithApproximation
{
public enum MotionModels
{
@ -447,7 +447,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// NetworkTransformOwnershipTests helper behaviour
/// </summary>
public class VerifyObjectIsSpawnedOnClient : NetworkBehaviour
internal class VerifyObjectIsSpawnedOnClient : NetworkBehaviour
{
public static Dictionary<ulong, VerifyObjectIsSpawnedOnClient> NetworkManagerRelativeSpawnedObjects = new Dictionary<ulong, VerifyObjectIsSpawnedOnClient>();
@ -512,7 +512,7 @@ namespace Unity.Netcode.RuntimeTests
/// This will have to be used to verify the ownership authority
/// </summary>
[DisallowMultipleComponent]
public class TestClientNetworkTransform : NetworkTransform
internal class TestClientNetworkTransform : NetworkTransform
{
//public override void OnNetworkSpawn()
//{

Просмотреть файл

@ -26,7 +26,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.Host, Authority.ServerAuthority, RotationCompression.None, Rotation.Quaternion, Precision.Half)]
[TestFixture(HostOrServer.Host, Authority.ServerAuthority, RotationCompression.QuaternionCompress, Rotation.Quaternion, Precision.Full)]
[TestFixture(HostOrServer.Host, Authority.ServerAuthority, RotationCompression.QuaternionCompress, Rotation.Quaternion, Precision.Half)]
public class NetworkTransformPacketLossTests : NetworkTransformBase
internal class NetworkTransformPacketLossTests : NetworkTransformBase
{
private const int k_Latency = 50;
private const int k_PacketLoss = 2;
@ -490,7 +490,7 @@ namespace Unity.Netcode.RuntimeTests
// Match the first position update
if (Approximately(m_RandomPosition, networkTransformState.GetPosition()))
{
// Teleport to the m_RandomPosition plus the
// Teleport to the m_RandomPosition plus the
m_AuthoritativeTransform.SetState(m_TeleportOffset + m_RandomPosition, null, null, false);
m_AuthoritativeTransform.AuthorityPushedTransformState -= OnAuthorityPushedTransformState;
m_Teleported = true;

Просмотреть файл

@ -15,7 +15,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(TransformSpace.World, Precision.Half, Rotation.Quaternion)]
[TestFixture(TransformSpace.Local, Precision.Full, Rotation.Quaternion)]
[TestFixture(TransformSpace.Local, Precision.Half, Rotation.Quaternion)]
public class NetworkTransformStateTests
internal class NetworkTransformStateTests
{
public enum SyncAxis
{

Просмотреть файл

@ -33,7 +33,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.Host, Authority.OwnerAuthority, RotationCompression.QuaternionCompress, Rotation.Quaternion, Precision.Full)]
[TestFixture(HostOrServer.Host, Authority.OwnerAuthority, RotationCompression.QuaternionCompress, Rotation.Quaternion, Precision.Half)]
#endif
public class NetworkTransformTests : NetworkTransformBase
internal class NetworkTransformTests : NetworkTransformBase
{
protected const int k_TickRate = 60;
/// <summary>
@ -311,7 +311,7 @@ namespace Unity.Netcode.RuntimeTests
Assert.True(WaitForConditionOrTimeOutWithTimeTravel(() => m_AuthoritativeTransform.StatePushed && m_NonAuthoritativeTransform.StateUpdated), $"[Non-Interpolate {i}] Timed out waiting for state to be pushed ({m_AuthoritativeTransform.StatePushed}) or state to be updated ({m_NonAuthoritativeTransform.StateUpdated})!");
// For 3 axis, we will skip validating that the non-authority interpolates to its target point at least once.
// This will validate that non-authoritative updates are maintaining their target state axis values if only 2
// This will validate that non-authoritative updates are maintaining their target state axis values if only 2
// of the axis are being updated to assure interpolation maintains the targeted axial value per axis.
// For 2 and 1 axis tests we always validate per delta update
if (m_AxisExcluded || axisCount < 3)

Просмотреть файл

@ -9,7 +9,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkUpdateLoopTests
internal class NetworkUpdateLoopTests
{
[Test]
public void RegisterCustomLoopInTheMiddle()

Просмотреть файл

@ -8,9 +8,9 @@ namespace Unity.Netcode.RuntimeTests
{
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
public class NetworkVarBufferCopyTest : NetcodeIntegrationTest
internal class NetworkVarBufferCopyTest : NetcodeIntegrationTest
{
public class DummyNetVar : NetworkVariableBase
internal class DummyNetVar : NetworkVariableBase
{
private const int k_DummyValue = 0x13579BDF;
public bool DeltaWritten;
@ -75,7 +75,7 @@ namespace Unity.Netcode.RuntimeTests
NetworkVariableWritePermission writePerm = DefaultWritePerm) : base(readPerm, writePerm) { }
}
public class DummyNetBehaviour : NetworkBehaviour
internal class DummyNetBehaviour : NetworkBehaviour
{
public static bool DistributedAuthority;
public DummyNetVar NetVar;

Просмотреть файл

@ -13,7 +13,7 @@ using Random = UnityEngine.Random;
namespace Unity.Netcode.RuntimeTests
{
[TestFixtureSource(nameof(TestDataSource))]
public class NetworkVariablePermissionTests : NetcodeIntegrationTest
internal class NetworkVariablePermissionTests : NetcodeIntegrationTest
{
public static IEnumerable<TestFixtureData> TestDataSource()
{
@ -304,7 +304,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct TestStruct : INetworkSerializable, IEquatable<TestStruct>
internal struct TestStruct : INetworkSerializable, IEquatable<TestStruct>
{
public uint SomeInt;
public bool SomeBool;
@ -344,7 +344,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class TestClass : INetworkSerializable, IEquatable<TestClass>
internal class TestClass : INetworkSerializable, IEquatable<TestClass>
{
public uint SomeInt;
public bool SomeBool;
@ -386,12 +386,12 @@ namespace Unity.Netcode.RuntimeTests
// Used just to create a NetworkVariable in the templated NetworkBehaviour type that isn't referenced anywhere else
// Please do not reference this class anywhere else!
public class TestClass_ReferencedOnlyByTemplateNetworkBehavourType : TestClass
internal class TestClass_ReferencedOnlyByTemplateNetworkBehavourType : TestClass
{
}
public class NetworkVariableTest : NetworkBehaviour
internal class NetworkVariableTest : NetworkBehaviour
{
public enum SomeEnum
{
@ -440,7 +440,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(true)]
#endif
[TestFixture(false)]
public class NetworkVariableTests : NetcodeIntegrationTest
internal class NetworkVariableTests : NetcodeIntegrationTest
{
private const string k_StringTestValue = "abcdefghijklmnopqrstuvwxyz";
private static readonly FixedString32Bytes k_FixedStringTestValue = k_StringTestValue;
@ -5130,7 +5130,7 @@ namespace Unity.Netcode.RuntimeTests
/// that accepts anything derived from the <see cref="ConditionalPredicateBase"/> class
/// as a parameter.
/// </summary>
public class NetworkListTestPredicate : ConditionalPredicateBase
internal class NetworkListTestPredicate : ConditionalPredicateBase
{
private const int k_MaxRandomValue = 1000;
@ -5296,7 +5296,7 @@ namespace Unity.Netcode.RuntimeTests
}
[TestFixtureSource(nameof(TestDataSource))]
public class NetworkVariableInheritanceTests : NetcodeIntegrationTest
internal class NetworkVariableInheritanceTests : NetcodeIntegrationTest
{
public NetworkVariableInheritanceTests(HostOrServer hostOrServer)
: base(hostOrServer)
@ -5308,7 +5308,7 @@ namespace Unity.Netcode.RuntimeTests
public static IEnumerable<TestFixtureData> TestDataSource() =>
Enum.GetValues(typeof(HostOrServer)).OfType<HostOrServer>().Select(x => new TestFixtureData(x));
public class ComponentA : NetworkBehaviour
internal class ComponentA : NetworkBehaviour
{
public NetworkVariable<int> PublicFieldA = new NetworkVariable<int>(1);
protected NetworkVariable<int> m_ProtectedFieldA = new NetworkVariable<int>(2);
@ -5329,7 +5329,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class ComponentB : ComponentA
internal class ComponentB : ComponentA
{
public NetworkVariable<int> PublicFieldB = new NetworkVariable<int>(11);
protected NetworkVariable<int> m_ProtectedFieldB = new NetworkVariable<int>(22);
@ -5350,7 +5350,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class ComponentC : ComponentB
internal class ComponentC : ComponentB
{
public NetworkVariable<int> PublicFieldC = new NetworkVariable<int>(111);
protected NetworkVariable<int> m_ProtectedFieldC = new NetworkVariable<int>(222);
@ -5447,7 +5447,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class NetvarDespawnShutdown : NetworkBehaviour
internal class NetvarDespawnShutdown : NetworkBehaviour
{
private NetworkVariable<int> m_IntNetworkVariable = new NetworkVariable<int>();
private NetworkList<int> m_IntList;
@ -5475,7 +5475,7 @@ namespace Unity.Netcode.RuntimeTests
/// Validates that setting values for NetworkVariable or NetworkList during the
/// OnNetworkDespawn method will not cause an exception to occur.
/// </summary>
public class NetworkVariableModifyOnNetworkDespawn : NetcodeIntegrationTest
internal class NetworkVariableModifyOnNetworkDespawn : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -5,24 +5,24 @@ using UnityEngine;
namespace Unity.Netcode.RuntimeTests
{
public class NetVarPermTestComp : NetworkBehaviour
internal class NetVarPermTestComp : NetworkBehaviour
{
public NetworkVariable<Vector3> OwnerWritable_Position = new NetworkVariable<Vector3>(Vector3.one, NetworkVariableBase.DefaultReadPerm, NetworkVariableWritePermission.Owner);
public NetworkVariable<Vector3> ServerWritable_Position = new NetworkVariable<Vector3>(Vector3.one, NetworkVariableBase.DefaultReadPerm, NetworkVariableWritePermission.Server);
public NetworkVariable<Vector3> OwnerReadWrite_Position = new NetworkVariable<Vector3>(Vector3.one, NetworkVariableReadPermission.Owner, NetworkVariableWritePermission.Owner);
}
public class NetworkVariableMiddleclass<TMiddleclassName> : NetworkVariable<TMiddleclassName>
internal class NetworkVariableMiddleclass<TMiddleclassName> : NetworkVariable<TMiddleclassName>
{
}
public class NetworkVariableSubclass<TSubclassName> : NetworkVariableMiddleclass<TSubclassName>
internal class NetworkVariableSubclass<TSubclassName> : NetworkVariableMiddleclass<TSubclassName>
{
}
public class NetworkBehaviourWithNetVarArray : NetworkBehaviour
internal class NetworkBehaviourWithNetVarArray : NetworkBehaviour
{
public NetworkVariable<int> Int0 = new NetworkVariable<int>();
public NetworkVariable<int> Int1 = new NetworkVariable<int>();
@ -123,7 +123,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct TemplatedValueOnlyReferencedByNetworkVariableSubclass<T> : INetworkSerializeByMemcpy
internal struct TemplatedValueOnlyReferencedByNetworkVariableSubclass<T> : INetworkSerializeByMemcpy
where T : unmanaged
{
public T Value;
@ -178,7 +178,7 @@ namespace Unity.Netcode.RuntimeTests
C = ulong.MaxValue
}
public struct HashableNetworkVariableTestStruct : INetworkSerializeByMemcpy, IEquatable<HashableNetworkVariableTestStruct>
internal struct HashableNetworkVariableTestStruct : INetworkSerializeByMemcpy, IEquatable<HashableNetworkVariableTestStruct>
{
public byte A;
public short B;
@ -220,7 +220,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct HashMapKeyStruct : INetworkSerializeByMemcpy, IEquatable<HashMapKeyStruct>
internal struct HashMapKeyStruct : INetworkSerializeByMemcpy, IEquatable<HashMapKeyStruct>
{
public byte A;
public short B;
@ -262,7 +262,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct HashMapValStruct : INetworkSerializeByMemcpy, IEquatable<HashMapValStruct>
internal struct HashMapValStruct : INetworkSerializeByMemcpy, IEquatable<HashMapValStruct>
{
public byte A;
public short B;
@ -304,7 +304,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public struct NetworkVariableTestStruct : INetworkSerializeByMemcpy
internal struct NetworkVariableTestStruct : INetworkSerializeByMemcpy
{
public byte A;
public short B;
@ -342,7 +342,7 @@ namespace Unity.Netcode.RuntimeTests
}
public class HashableNetworkVariableTestClass : INetworkSerializable, IEquatable<HashableNetworkVariableTestClass>
internal class HashableNetworkVariableTestClass : INetworkSerializable, IEquatable<HashableNetworkVariableTestClass>
{
public HashableNetworkVariableTestStruct Data;
@ -367,7 +367,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class HashMapKeyClass : INetworkSerializable, IEquatable<HashMapKeyClass>
internal class HashMapKeyClass : INetworkSerializable, IEquatable<HashMapKeyClass>
{
public HashMapKeyStruct Data;
@ -392,7 +392,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class HashMapValClass : INetworkSerializable, IEquatable<HashMapValClass>
internal class HashMapValClass : INetworkSerializable, IEquatable<HashMapValClass>
{
public HashMapValStruct Data;
@ -417,7 +417,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class NetworkVariableTestClass : INetworkSerializable, IEquatable<NetworkVariableTestClass>
internal class NetworkVariableTestClass : INetworkSerializable, IEquatable<NetworkVariableTestClass>
{
public NetworkVariableTestStruct Data;
@ -446,7 +446,7 @@ namespace Unity.Netcode.RuntimeTests
// The ILPP code for NetworkVariables to determine how to serialize them relies on them existing as fields of a NetworkBehaviour to find them.
// Some of the tests below create NetworkVariables on the stack, so this class is here just to make sure the relevant types are all accounted for.
public class NetVarILPPClassForTests : NetworkBehaviour
internal class NetVarILPPClassForTests : NetworkBehaviour
{
public NetworkVariable<byte> ByteVar;
public NetworkVariable<NativeArray<byte>> ByteArrayVar;
@ -887,34 +887,34 @@ namespace Unity.Netcode.RuntimeTests
public NetworkVariableSubclass<TemplatedValueOnlyReferencedByNetworkVariableSubclass<int>> SubclassVar;
}
public class TemplateNetworkBehaviourType<T> : NetworkBehaviour
internal class TemplateNetworkBehaviourType<T> : NetworkBehaviour
{
public NetworkVariable<T> TheVar;
}
public class IntermediateNetworkBehavior<T> : TemplateNetworkBehaviourType<T>
internal class IntermediateNetworkBehavior<T> : TemplateNetworkBehaviourType<T>
{
public NetworkVariable<T> TheVar2;
}
#if !NGO_MINIMALPROJECT
public class ClassHavingNetworkBehaviour : IntermediateNetworkBehavior<TestClass>
internal class ClassHavingNetworkBehaviour : IntermediateNetworkBehavior<TestClass>
{
}
// Please do not reference TestClass_ReferencedOnlyByTemplateNetworkBehavourType anywhere other than here!
public class ClassHavingNetworkBehaviour2 : TemplateNetworkBehaviourType<TestClass_ReferencedOnlyByTemplateNetworkBehavourType>
internal class ClassHavingNetworkBehaviour2 : TemplateNetworkBehaviourType<TestClass_ReferencedOnlyByTemplateNetworkBehavourType>
{
}
public class StructHavingNetworkBehaviour : TemplateNetworkBehaviourType<TestStruct>
internal class StructHavingNetworkBehaviour : TemplateNetworkBehaviourType<TestStruct>
{
}
#endif
public struct StructUsedOnlyInNetworkList : IEquatable<StructUsedOnlyInNetworkList>, INetworkSerializeByMemcpy
internal struct StructUsedOnlyInNetworkList : IEquatable<StructUsedOnlyInNetworkList>, INetworkSerializeByMemcpy
{
public int Value;

Просмотреть файл

@ -9,15 +9,15 @@ using Object = UnityEngine.Object;
namespace Unity.Netcode.RuntimeTests
{
public struct MyTypeOne
internal struct MyTypeOne
{
public int Value;
}
public struct MyTypeTwo
internal struct MyTypeTwo
{
public int Value;
}
public struct MyTypeThree
internal struct MyTypeThree
{
public int Value;
}
@ -25,7 +25,7 @@ namespace Unity.Netcode.RuntimeTests
/// <summary>
/// Used to help track instances of any child derived class
/// </summary>
public class WorkingUserNetworkVariableComponentBase : NetworkBehaviour
internal class WorkingUserNetworkVariableComponentBase : NetworkBehaviour
{
private static Dictionary<ulong, WorkingUserNetworkVariableComponentBase> s_Instances = new Dictionary<ulong, WorkingUserNetworkVariableComponentBase>();
@ -68,16 +68,16 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class WorkingUserNetworkVariableComponent : WorkingUserNetworkVariableComponentBase
internal class WorkingUserNetworkVariableComponent : WorkingUserNetworkVariableComponentBase
{
public NetworkVariable<MyTypeOne> NetworkVariable = new NetworkVariable<MyTypeOne>();
}
public class WorkingUserNetworkVariableComponentUsingExtensionMethod : WorkingUserNetworkVariableComponentBase
internal class WorkingUserNetworkVariableComponentUsingExtensionMethod : WorkingUserNetworkVariableComponentBase
{
public NetworkVariable<MyTypeTwo> NetworkVariable = new NetworkVariable<MyTypeTwo>();
}
public class NonWorkingUserNetworkVariableComponent : NetworkBehaviour
internal class NonWorkingUserNetworkVariableComponent : NetworkBehaviour
{
public NetworkVariable<MyTypeThree> NetworkVariable = new NetworkVariable<MyTypeThree>();
}
@ -96,7 +96,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class NetworkVariableUserSerializableTypesTests : NetcodeIntegrationTest
internal class NetworkVariableUserSerializableTypesTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -11,7 +11,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(SceneManagementState.SceneManagementDisabled, SessionModeTypes.DistributedAuthority)]
[TestFixture(SceneManagementState.SceneManagementEnabled, SessionModeTypes.ClientServer)]
[TestFixture(SceneManagementState.SceneManagementDisabled, SessionModeTypes.ClientServer)]
public class NetworkVisibilityTests : NetcodeIntegrationTest
internal class NetworkVisibilityTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Просмотреть файл

@ -12,7 +12,7 @@ namespace Unity.Netcode.RuntimeTests
// Where the NetworkVariable updates would be repeated on some clients.
// The twist comes fom the updates needing to happens very specifically for the issue to repro in tests
public class OwnerModifiedObject : NetworkBehaviour, INetworkUpdateSystem
internal class OwnerModifiedObject : NetworkBehaviour, INetworkUpdateSystem
{
public NetworkList<int> MyNetworkList;
@ -76,7 +76,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
public class OwnerModifiedTests : NetcodeIntegrationTest
internal class OwnerModifiedTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -7,7 +7,7 @@ using UnityEngine.TestTools;
namespace Unity.Netcode.RuntimeTests
{
public class OwnerPermissionObject : NetworkBehaviour
internal class OwnerPermissionObject : NetworkBehaviour
{
// indexed by [object, machine]
public static OwnerPermissionObject[,] Objects = new OwnerPermissionObject[3, 3];
@ -85,7 +85,7 @@ namespace Unity.Netcode.RuntimeTests
}
}
public class OwnerPermissionHideTests : NetcodeIntegrationTest
internal class OwnerPermissionHideTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 2;

Просмотреть файл

@ -21,7 +21,7 @@ namespace Unity.Netcode.RuntimeTests
/// </summary>
[TestFixture(HostOrServer.Server)]
[TestFixture(HostOrServer.Host)]
public class PeerDisconnectCallbackTests : NetcodeIntegrationTest
internal class PeerDisconnectCallbackTests : NetcodeIntegrationTest
{
public enum ClientDisconnectType

Просмотреть файл

@ -8,12 +8,12 @@ using Unity.Netcode.TestHelpers.Runtime;
namespace Unity.Netcode.RuntimeTests
{
public class NetworkRigidbody2DDynamicTest : NetworkRigidbody2DTestBase
internal class NetworkRigidbody2DDynamicTest : NetworkRigidbody2DTestBase
{
public override bool Kinematic => false;
}
public class NetworkRigidbody2DKinematicTest : NetworkRigidbody2DTestBase
internal class NetworkRigidbody2DKinematicTest : NetworkRigidbody2DTestBase
{
public override bool Kinematic => true;
}

Просмотреть файл

@ -13,7 +13,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(RigidbodyInterpolation.Extrapolate, false, true)] // This should allow extrapolation on non-auth instances when using Rigidbody & NT has no interpolation
[TestFixture(RigidbodyInterpolation.Interpolate, true, false)] // This should not allow kinematic instances to have Rigidbody interpolation enabled
[TestFixture(RigidbodyInterpolation.Interpolate, false, false)] // Testing that rigid body interpolation remains the same if NT interpolate is disabled
public class NetworkRigidbodyTest : NetcodeIntegrationTest
internal class NetworkRigidbodyTest : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;
private bool m_NetworkTransformInterpolate;

Просмотреть файл

@ -9,7 +9,7 @@ namespace Unity.Netcode.RuntimeTests
[TestFixture(HostOrServer.DAHost)]
[TestFixture(HostOrServer.Host)]
[TestFixture(HostOrServer.Server)]
public class PlayerObjectTests : NetcodeIntegrationTest
internal class PlayerObjectTests : NetcodeIntegrationTest
{
protected override int NumberOfClients => 1;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше