public void SerializeException_WithoutProperties_SerializesWithoutProperties() { // Arrange var innerException = new InvalidOperationException("Problem with update"); var exception = new LogicAppNotUpdatedException("App not updated", innerException); var expected = exception.ToString(); // Act LogicAppNotUpdatedException actual = SerializeDeserializeException(exception); // Assert Assert.Equal(expected, actual.ToString()); }
public void SerializeException_WithProperties_SerializeWithProperties() { // Arrange string logicApp = "logic app name", resourceGroup = "resouce group", subscriptionId = "subscription ID"; var innerException = new KeyNotFoundException("Problem with update"); var exception = new LogicAppNotUpdatedException(subscriptionId, resourceGroup, logicApp, "App not updated", innerException); string expected = exception.ToString(); // Act LogicAppNotUpdatedException actual = SerializeDeserializeException(exception); // Assert Assert.Equal(expected, actual.ToString()); Assert.Equal(logicApp, actual.LogicAppName); Assert.Equal(resourceGroup, actual.ResourceGroup); Assert.Equal(subscriptionId, actual.SubscriptionId); }