void Start() { if (SceneManager.GetActiveScene().name == "Level2_1_1" || SceneManager.GetActiveScene().name == "Level2_2") { controller = GetComponent <itemsController>(); itemsController = (itemsController)controller; } }
public void ShouldGetAllItems() { //Arrange itemsController controller = new itemsController(); List <acronymedItem> expectedResult = new List <acronymedItem>(); expectedResult.Add(new acronymedItem { id = 1, type = "Story", priority = 1, title = "Header", description = "Display a header with buttons that displays modals for different actions. These buttons will be History, Release, New Project and New Item.", status = "Released", acronym = "UI" }); //Act var result = controller.Getitems() as List <acronymedItem>; //Assert Assert.AreEqual(expectedResult[0], result[0]); }
public void TestInitialize() { // this method runs automatically // create a new mock data object to hold fake list data mock = new Mock <IitemsMock>(); //populate mock data items = new List <item> { new item { item_id = 100, item_name = "new book", item_price = 200, item_quantity = 2 }, new item { item_id = 101, item_name = "rent book", item_price = 100, item_quantity = 1 }, new item { item_id = 101, item_name = "old book", item_price = 100, item_quantity = 1 } }; //put list into the mock object and pass mock.Setup(m => m.items).Returns(items.AsQueryable()); controller = new itemsController(mock.Object); }