using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.SceneManagement;

public class RoomAssignTests
{
	
	[OneTimeSetUp]
    public void OneTimeSetup()
    {
        SceneManager.LoadScene("Scenes/Demo/Demo_Start", LoadSceneMode.Single); // Selects scene for test
    }
    // A Test behaves as an ordinary method
    [UnityTest]
    public IEnumerator AssignedBossRoomTest()
    {
		GameObject MapGen = GameObject.FindWithTag("Map");
		MapGeneration Script = MapGen.GetComponent();
		int rows = Script.grid.GetLength(0); // Get the number of rows
		int cols = Script.grid.GetLength(1); // Get the number of columns
        for(int i = 0; i < rows; i++){
			for(int j = 0; j < cols; j++){
				if(Script.grid[i, j].visual == 'B'){
					Assert.IsTrue(Script.grid[i,j].visual == 'B');
				}
			}
		}
		return null;
    }
	
	[UnityTest]
    public IEnumerator AssignedItemRoomTest()
    {
		GameObject MapGen = GameObject.FindWithTag("Map");
		MapGeneration Script = MapGen.GetComponent();
		int rows = Script.grid.GetLength(0); // Get the number of rows
		int cols = Script.grid.GetLength(1); // Get the number of columns
        for(int i = 0; i < rows; i++){
			for(int j = 0; j < cols; j++){
				if(Script.grid[i, j].visual == 'I'){
					Assert.IsTrue(Script.grid[i,j].visual == 'I');
				}
			}
		}
		return null;
    }
	
		[UnityTest]
    public IEnumerator AssignedStartRoomTest()
    {
		GameObject MapGen = GameObject.FindWithTag("Map");
		MapGeneration Script = MapGen.GetComponent();
		int rows = Script.grid.GetLength(0); // Get the number of rows
		int cols = Script.grid.GetLength(1); // Get the number of columns
        for(int i = 0; i < rows; i++){
			for(int j = 0; j < cols; j++){
				if(Script.grid[i, j].visual == 'S'){
					Assert.IsTrue(Script.grid[i,j].visual == 'S');
				}
			}
		}
		return null;
    }
}