コード例 #1
0
        public void ShouldCallWeatherServiceForZip()
        {
            _sut = new TowIfSnowOnGround(_weatherService.Object, 60606);
            var result = _sut.ShouldTowCar();

            _weatherService.Verify(x => x.IsSnowOnTheGroundByZip(60606), Times.Once);
        }
コード例 #2
0
        public void ShouldNotTowCarIfNoSnow()
        {
            _weatherService.Setup(x => x.IsSnowOnTheGroundByZip(60606)).Returns(false);
            _sut = new TowIfSnowOnGround(_weatherService.Object, 60606);
            var result = _sut.ShouldTowCar();

            Assert.IsFalse(result);
        }
コード例 #3
0
        public void TowCarIfSnowInZip()
        {
            _weatherService.Setup(x => x.IsSnowOnTheGroundByZip(60606)).Returns(true);
            _sut = new TowIfSnowOnGround(_weatherService.Object, 60606);
            var result = _sut.ShouldTowCar();

            Assert.IsTrue(result);
        }