public IActionResult List() { var equipmentsRequest = new EquipmentsRequest(); EquipmentsListResponse reply = _client.GetAllEquipments(equipmentsRequest); return(View(reply)); }
public async Task AddNewEquipment() { EquipmentToAdd newEquipment = new EquipmentToAdd { Name = "Nowy Sprzęt Testowy", SerialNumber = _uniqSerialNumber, Type = EquipmentType.Agd }; await _client.AddEquipmentAsync(newEquipment); var warehouseAfterAdd = _client.GetAllEquipments(_equipmentsRequest); int warehouseBeforeSize = _warehouseBeforeAdd.EquipmentList.Count; int warehouseAfterSize = warehouseAfterAdd.EquipmentList.Count; Assert.AreEqual(1, warehouseAfterSize - warehouseBeforeSize); }
public void Setup() { string serverAddress = "https://localhost:5002"; _channel = GrpcChannel.ForAddress(serverAddress); _client = new EquipmentsClient(_channel); _random = new Random(); _equipmentsRequest = new EquipmentsRequest(); _warehouseBeforeAdd = _client.GetAllEquipments(_equipmentsRequest); _uniqSerialNumber = findUniqSerialNumber(_warehouseBeforeAdd.EquipmentList, 10); }