コード例 #1
0
        public void SeatingBL_candidate_check_makes_UpdateLicense_throw() {

            // Arrange
            var newLicense = new XDoc("new");
            var licenseData = new LicenseData();
            var testException = new Utils.TestException();
            _seatingBLMock.Setup(x => x.ValidateLicenseUpdateUser(newLicense)).Throws(testException);

            // Act
            try {
                _licenseController.UpdateLicense(newLicense, licenseData, _licenseBLMock.Object, _seatingBLMock.Object);

                // Assert
                Assert.Fail("wow, no throw");
            } catch(Utils.TestException e) {
                Assert.AreSame(testException, e);
            }
        }
コード例 #2
0
        public void SeatingBL_candidate_check_makes_UpdateLicense_throw()
        {
            // Arrange
            var newLicense    = new XDoc("new");
            var licenseData   = new LicenseData();
            var testException = new Utils.TestException();

            _seatingBLMock.Setup(x => x.ValidateLicenseUpdateUser(newLicense)).Throws(testException);

            // Act
            try {
                _licenseController.UpdateLicense(newLicense, licenseData, _licenseBLMock.Object, _seatingBLMock.Object);

                // Assert
                Assert.Fail("wow, no throw");
            } catch (Utils.TestException e) {
                Assert.AreSame(testException, e);
            }
        }