예제 #1
0
        public void DestroyLocation_GivenANullLocation_ThrowsArgumentException()
        {
            var locationRepository = new Mock<ILocationRepository> ();
            var locationFactory = new LocationFactory ( locationRepository.Object );

            locationFactory.DestroyLocation ( null );
        }
예제 #2
0
        public void DestroyLocation_GivenALocation_LocationIsTransient()
        {
            var isTransient = false;

            var locationRepository = new Mock<ILocationRepository> ();
            locationRepository
                .Setup ( l => l.MakeTransient ( It.IsAny<Location> () ) )
                .Callback ( () => isTransient = true );

            var locationFactory = new LocationFactory ( locationRepository.Object );
            var location = new Mock<Location> ();

            locationFactory.DestroyLocation ( location.Object );

            Assert.IsTrue ( isTransient );
        }