Exemplo n.º 1
0
        public IActionResult List()
        {
            var equipmentsRequest        = new EquipmentsRequest();
            EquipmentsListResponse reply = _client.GetAllEquipments(equipmentsRequest);

            return(View(reply));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }