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); } }
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); } }