Skip to content

Commit

Permalink
Use local function instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed May 14, 2023
1 parent 66d95c8 commit bd6c316
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ public class TheDisposeMethod
[Fact]
public void ShouldRemoveArtifactsThatWereSet()
{
using var image = new MagickImage();
image.SetArtifact("foo", "bar");

using (var temporaryDefines = new TemporaryDefines(image))
static void SetTemporaryArtifact(MagickImage image)
{
using var temporaryDefines = new TemporaryDefines(image);
temporaryDefines.SetArtifact("bar", "foo");
}

using var image = new MagickImage();
image.SetArtifact("foo", "bar");
SetTemporaryArtifact(image);

Assert.Null(image.GetArtifact("bar"));
Assert.Equal("bar", image.GetArtifact("foo"));
}
Expand Down

0 comments on commit bd6c316

Please sign in to comment.