Class FoundationReferenceWalkerTests
Tests for Serenity.Global.Infrastructure.Editor.Validation.FoundationReferenceWalker's AssetKey support: a type with no declared
FoundationReferenceContracts row but at least one [AssetPathField] field must
still be walked, emitting one Serenity.Global.Infrastructure.Editor.Validation.FoundationReferenceSite per match with
AssetKey and the attribute's asset type resolved.
Inherited Members
Namespace: Serenity.UnityValidation.Tests.Editor
Assembly: Serenity.UnityValidation.Tests.Editor.dll
Syntax
public class FoundationReferenceWalkerTests
Constructors
FoundationReferenceWalkerTests()
Declaration
public FoundationReferenceWalkerTests()
Methods
HasContractsFor_TypeWithAnAssetPathFieldAndNoContractRows_ReturnsTrue()
Declaration
public void HasContractsFor_TypeWithAnAssetPathFieldAndNoContractRows_ReturnsTrue()
HasContractsFor_TypeWithNeitherContractRowsNorAssetPathFields_ReturnsFalse()
Declaration
public void HasContractsFor_TypeWithNeitherContractRowsNorAssetPathFields_ReturnsFalse()
ManagedReferenceTypename_IsTheAssemblyNameThenTheFullNameWithNestedTypesAfterASlash()
The walker compares against the way Unity names a stored reference, so that format is asserted here from Unity itself rather than assumed.
Declaration
public void ManagedReferenceTypename_IsTheAssemblyNameThenTheFullNameWithNestedTypesAfterASlash()
WalkContracts_AFieldDeclaredOnAGlobalNamespaceType_IsWalkedForThatTypeOnly()
The contract names the declaring type by its full name, so a signal declared in the global
namespace — which Unity writes as Assembly Type, with no dot at all — is still told apart.
Declaration
public void WalkContracts_AFieldDeclaredOnAGlobalNamespaceType_IsWalkedForThatTypeOnly()
WalkContracts_AFieldDeclaredOnANestedType_IsWalkedForThatTypeOnly()
Unity writes a nested type as Outer/Inner; the row still has to find it.
Declaration
public void WalkContracts_AFieldDeclaredOnANestedType_IsWalkedForThatTypeOnly()
WalkContracts_ASignalSharingItsShortNameWithAnotherNamespacesType_IsNotConfusedWithIt()
Two signals can share a short name across namespaces; a declaration made on one never reaches the other, whichever order they are stored in.
Declaration
public void WalkContracts_ASignalSharingItsShortNameWithAnotherNamespacesType_IsNotConfusedWithIt()
Walk_ACollectionBelowAPlainField_EmitsOneSitePerElement()
A collection that sits BELOW a plain field (a modal keeps its options inside its
showModalParameters) is walked like one at the top: one site per element. The modal rows used
to be declared and never found, because the walker only expanded a collection in the first segment.
Declaration
public void Walk_ACollectionBelowAPlainField_EmitsOneSitePerElement()
Walk_AFieldDeclaredOnOneSignalType_AppliesOnlyToAnElementOfThatType()
Two signal types can both have a field named alike; a declaration made on one of them
applies only to an element that IS that type, so the HUD id of a show-HUD signal is read once, not
once per signal type that declares a HudId.
Declaration
public void Walk_AFieldDeclaredOnOneSignalType_AppliesOnlyToAnElementOfThatType()
Walk_AStringOptionsIdIsAGameSettingReferenceUnlessTheOptionIsASubmitButton(int, int)
A submit-style option is a button: its Id names the button, so no game setting is claimed — otherwise every button a modal wizard creates would read as a dangling setting reference.
Declaration
public void Walk_AStringOptionsIdIsAGameSettingReferenceUnlessTheOptionIsASubmitButton(int interactionTypeIndex, int expectedGameSettingSiteCount)
Parameters
| Type | Name | Description |
|---|---|---|
| int | interactionTypeIndex | |
| int | expectedGameSettingSiteCount |
Walk_TypeWithAnAssetPathFieldAndNoContractRows_EmitsAnAssetKeySite()
Declaration
public void Walk_TypeWithAnAssetPathFieldAndNoContractRows_EmitsAnAssetKeySite()