public void SetUp() { _mockRestClient = new Mock <IRestClient>(); _mockLogger = new Mock <ILogger>(); _aruaApi = new AruaApi(_mockRestClient.Object, _mockLogger.Object, TEST_URL, TEST_KEY); _testItem = StockItemTestData.Generate(); }
public void GetAllStockItems_WithResultsResponse_ReturnsList() { StockItem expectedStockItem = StockItemTestData.Generate(); MockGetAllResponse(ArtsApiTestData.GET_ALL_STOCK_ITEMS_RESULTS_RESPONSE); List <StockItem> stockItems = _artsApi.GetAllStockItems(); Assert.AreEqual(1, stockItems.Count); Assert.AreEqual(expectedStockItem.StockItemId, stockItems[0].StockItemId); Assert.AreEqual(expectedStockItem.StockItemGroupId, stockItems[0].StockItemGroupId); Assert.AreEqual(expectedStockItem.ItemId, stockItems[0].ItemId); Assert.AreEqual(expectedStockItem.Name, stockItems[0].Name); Assert.AreEqual(expectedStockItem.ShortName, stockItems[0].ShortName); Assert.AreEqual(expectedStockItem.DateAdded, stockItems[0].DateAdded); Assert.AreEqual(expectedStockItem.IsTracked, stockItems[0].IsTracked); }