feat: l geminada working
This commit is contained in:
		
							parent
							
								
									1869a92580
								
							
						
					
					
						commit
						30ca50fb35
					
				
					 15 changed files with 189 additions and 29 deletions
				
			
		
							
								
								
									
										50
									
								
								Assets/Scripts/Tests/KeySequenceTests.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Assets/Scripts/Tests/KeySequenceTests.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,50 @@
 | 
			
		|||
using System.Collections.Generic;
 | 
			
		||||
using Domain;
 | 
			
		||||
using NUnit.Framework;
 | 
			
		||||
 | 
			
		||||
public class KeySequenceTests {
 | 
			
		||||
	[Test]
 | 
			
		||||
	public void NoPresses_DontContain() {
 | 
			
		||||
		List<int> sequence = new() { 0x1, 0x2, 0x3 };
 | 
			
		||||
		KeyHistory history = new();
 | 
			
		||||
 | 
			
		||||
		Assert.IsFalse(history.ContainsSequence(sequence));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	[Test]
 | 
			
		||||
	public void CorrectPresses_Contains() {
 | 
			
		||||
		List<int> sequence = new() { 0x1, 0x2, 0x3 };
 | 
			
		||||
		KeyHistory history = new();
 | 
			
		||||
 | 
			
		||||
		history.KeyPressed(0x1);
 | 
			
		||||
		history.KeyPressed(0x2);
 | 
			
		||||
		history.KeyPressed(0x3);
 | 
			
		||||
 | 
			
		||||
		Assert.IsTrue(history.ContainsSequence(sequence));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	[Test]
 | 
			
		||||
	public void CorrectPresses_BeforeLast_DontContain() {
 | 
			
		||||
		List<int> sequence = new() { 0x1, 0x2, 0x3 };
 | 
			
		||||
		KeyHistory history = new();
 | 
			
		||||
 | 
			
		||||
		history.KeyPressed(0x1);
 | 
			
		||||
		history.KeyPressed(0x2);
 | 
			
		||||
		history.KeyPressed(0x3);
 | 
			
		||||
		history.KeyPressed(0x1);
 | 
			
		||||
 | 
			
		||||
		Assert.IsFalse(history.ContainsSequence(sequence));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	[Test]
 | 
			
		||||
	public void IncorrectPresses_DontContain() {
 | 
			
		||||
		List<int> sequence = new() { 0x1, 0x2, 0x3 };
 | 
			
		||||
		KeyHistory history = new();
 | 
			
		||||
 | 
			
		||||
		history.KeyPressed(0x1);
 | 
			
		||||
		history.KeyPressed(0x3);
 | 
			
		||||
		history.KeyPressed(0x2);
 | 
			
		||||
 | 
			
		||||
		Assert.IsFalse(history.ContainsSequence(sequence));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/Tests/KeySequenceTests.cs.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/Tests/KeySequenceTests.cs.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: d8ab5fe36e022dd4d9dbbb15c6198fb3
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
							
								
								
									
										24
									
								
								Assets/Scripts/Tests/Tests.asmdef
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Assets/Scripts/Tests/Tests.asmdef
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
{
 | 
			
		||||
    "name": "Tests",
 | 
			
		||||
    "rootNamespace": "",
 | 
			
		||||
    "references": [
 | 
			
		||||
        "UnityEngine.TestRunner",
 | 
			
		||||
        "UnityEditor.TestRunner",
 | 
			
		||||
        "SantJordi.Domain"
 | 
			
		||||
    ],
 | 
			
		||||
    "includePlatforms": [
 | 
			
		||||
        "Editor"
 | 
			
		||||
    ],
 | 
			
		||||
    "excludePlatforms": [],
 | 
			
		||||
    "allowUnsafeCode": false,
 | 
			
		||||
    "overrideReferences": true,
 | 
			
		||||
    "precompiledReferences": [
 | 
			
		||||
        "nunit.framework.dll"
 | 
			
		||||
    ],
 | 
			
		||||
    "autoReferenced": false,
 | 
			
		||||
    "defineConstraints": [
 | 
			
		||||
        "UNITY_INCLUDE_TESTS"
 | 
			
		||||
    ],
 | 
			
		||||
    "versionDefines": [],
 | 
			
		||||
    "noEngineReferences": false
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								Assets/Scripts/Tests/Tests.asmdef.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/Scripts/Tests/Tests.asmdef.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: e70aee605542b224b8274efcc111c230
 | 
			
		||||
AssemblyDefinitionImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue