public void CreateWithpermission()
 {
     TestHelpers.EnsureLanguageIsValid();
     string permission = "Something";
     PermissionDeniedException exception = new PermissionDeniedException(permission);
     Assert.AreEqual("Permission to execute 'Something' has been denied.", exception.Message);
     Assert.AreEqual(permission, exception.Permission);
 }
 public void CreateWithpermissionAndMessage()
 {
     TestHelpers.EnsureLanguageIsValid();
     string permission = "Something";
     string message = "An error has occured";
     PermissionDeniedException exception = new PermissionDeniedException(permission, message);
     Assert.AreEqual(message, exception.Message);
     Assert.AreEqual(permission, exception.Permission);
 }
 public void PassThroughSerialisation()
 {
     TestHelpers.EnsureLanguageIsValid();
     string permission = "Something";
     PermissionDeniedException exception = new PermissionDeniedException(permission);
     object result = TestHelpers.RunSerialisationTest(exception);
     Assert.IsNotNull(result);
     Assert.IsInstanceOfType(typeof(PermissionDeniedException), result);
     Assert.AreEqual("Permission to execute 'Something' has been denied.", exception.Message);
     Assert.AreEqual(permission, (result as PermissionDeniedException).Permission);
 }