示例#1
0
        public void ThrowArgumentExcpetion_WhenEmptyCollectionIsPassed()
        {
            //Arrange
            var sessionMock = new Mock <IUserSession>();
            var serviceMock = new Mock <ICarService>();
            var sut         = new ViewCarDetailsCommand(sessionMock.Object, serviceMock.Object);
            var args        = new string[0];

            //Act && Assert
            Assert.ThrowsException <ArgumentException>(() => sut.Execute(args));
        }
示例#2
0
        public void ThrowFormatExcpetion_WhenNonIntegerIdIsPassed()
        {
            //Arrange
            var sessionMock = new Mock <IUserSession>();
            var serviceMock = new Mock <ICarService>();
            var sut         = new ViewCarDetailsCommand(sessionMock.Object, serviceMock.Object);
            var args        = new string[1] {
                "a"
            };

            //Act && Assert
            Assert.ThrowsException <FormatException>(() => sut.Execute(args));
        }