public void AddInstrument() { // Arrange var instrumentCreation = new InstrumentCreation() { Name = InstrumentName.EUR_USD }; var createdInstrument = new Instrument() { Name = instrumentCreation.Name }; _instrumentServiceMock.Setup(ism => ism.AddInstrument(instrumentCreation)).Returns(createdInstrument); // Act var instrumentCreated = _instrumentsController.AddInstrument(instrumentCreation); // Assert _instrumentServiceMock.Verify(ism => ism.AddInstrument(instrumentCreation), Times.Once()); Assert.Equal(createdInstrument, instrumentCreated); }
public Instrument AddInstrument([FromBody] InstrumentCreation instrument) { return(_instrumentService.AddInstrument(instrument)); }