コード例 #1
0
        public void Find_MethodNotCalled()
        {
            Mock <ISource> source = new Mock <ISource>();

            var provider = new EmployeeProvider(source.Object);

            Assert.That(() => { provider.Find(null); }, Throws.ArgumentNullException);
            source.Verify(s => s.FindByName(null), Times.Never);
        }
コード例 #2
0
        public void Find_MethodNotCalled()
        {
            ISource source = Substitute.For <ISource>();

            var provider = new EmployeeProvider(source);

            Assert.That(() => { provider.Find(null); }, Throws.ArgumentNullException);
            source.DidNotReceiveWithAnyArgs().FindByName(null);
        }