public void Buy_NotInitialized_ThrowsException() { var subject = new DemoBroker(Mock.Of <IExchange>()); var exception = Expect.ThrowAsync <InvalidOperationException>(async() => { await subject.Buy(new Sample()); }); Assert.AreEqual("Broker cannot Buy until Initialized!", exception.Message); }
public void Buy_NullSample_ThrowsException() { var subject = new DemoBroker(Mock.Of <IExchange>()); var exception = Expect.ThrowAsync <ArgumentNullException>(async() => { await subject.Buy(null); }); Assert.AreEqual("rate", exception.ParamName); }