public void ChooseLevel() { bool validLevel = false; while (!validLevel) { GenerateLevel(); searchSpace.UpdateSearchSpace(); for (int i = 0; i < numberOfLanes; i++) { searchSpace.startRow.Add(searchSpace.tiles[i]); } for (int i = numberOfRows * numberOfLanes - numberOfLanes; i < numberOfRows * numberOfLanes; i++) { bool found = UsePathfinderOnce(searchSpace.tiles[i]); if (found) { validLevel = true; break; } } } if (theme.extras.Count > 0) { InstantiateExtras(); } if (validLevel) { for (int i = 0; i < searchSpace.tiles.Count; i++) { Tile tile = searchSpace.tiles[i]; if (tile.hasObstacle && tile.obstacle.obstaclePrefab != null) { ObstacleInstance obstacle = tile.obstacle; Transform transform = tile.gameObject.transform; InstantiateObstacle(obstacle, transform, levelObstacles.transform); } } } }
public void UpdateSearchSpace_ErrorResponse_Failure() { Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.PUT, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); var res = SearchSpace.UpdateSearchSpace(_mockServer, "ObjectId", "New Name", "New Description"); Assert.IsFalse(res.Success, "Calling UpdateSearchSpace with ErrorResponse did not fail"); }
public void SearchSpaceUpdateTests() { var res = _searchSpace.Update(_searchSpace.Name, _searchSpace.Description + "new"); Assert.IsTrue(res.Success, "Update of SearchSpace description failed:" + res); //search space member functions List <Partition> oPartitions; res = Partition.GetPartitions(_connectionServer, out oPartitions); Assert.IsTrue(res.Success, "Fetching of partitions failed:" + res); Assert.IsTrue(oPartitions.Count > 0, "No partitions returned in search"); res = _searchSpace.AddSearchSpaceMember(oPartitions[0].ObjectId, 99); Assert.IsTrue(res.Success, "Adding partition as search space member failed:" + res); Assert.IsTrue(_searchSpace.GetSearchSpaceMembers().Count == 1, "Search space member count not accurate after partition add:" + res); res = _searchSpace.DeleteSearchSpaceMember(oPartitions[0].ObjectId); Assert.IsTrue(res.Success, "Removing partition as search space member failed:" + res); res = SearchSpace.UpdateSearchSpace(_connectionServer, _searchSpace.ObjectId, "NewName" + Guid.NewGuid(), "NewDescription"); Assert.IsTrue(res.Success, "Update of SearchSpace via static method failed:" + res); }
public void UpdateSearchSpace_InvalidObjectId_Failure() { var res = SearchSpace.UpdateSearchSpace(_connectionServer, "ObjectId"); Assert.IsFalse(res.Success, "Static method for update SearchSpace did not fail with empty SearchSpace ObjectId"); }
public void UpdateSearchSpace_EmptyObjectId_Failure() { var res = SearchSpace.UpdateSearchSpace(_mockServer, ""); Assert.IsFalse(res.Success, "Static method for update SearchSpace did not fail with empty SearchSpace ObjectId"); }
public void UpdateSearchSpace_NullConnectionServer_Failure() { var res = SearchSpace.UpdateSearchSpace(null, "ObjectId"); Assert.IsFalse(res.Success, "Static method for update SearchSpace did not fail with null ConnectionServer"); }