Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }