Skip to content

Commit

Permalink
Use \ instead of / for path delimiters.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpmorris committed Dec 20, 2024
1 parent c575f51 commit 6d858b4
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using Xunit;

namespace Fluxor.UnitTests.DisposableCallbackTests;
Expand All @@ -23,19 +22,16 @@ public void WhenCalled_ThenCallsActionPassedInConstructor()
[Fact]
public void WhenCalledTwice_ThenThrowsObjectDisposedExceptionWithCallerInformation()
{
string ExpectedSubstring =
@"Fluxor.UnitTests\DisposableCallbackTests\DisposeTests.cs"" on line "
.Replace(Path.PathSeparator, '/');
var subject = new DisposableCallback(
$"{nameof(DisposeTests)}.{nameof(WhenCalledTwice_ThenThrowsObjectDisposedExceptionWithCallerInformation)}",
() => { });

var subject = new DisposableCallback(
$"{nameof(DisposeTests)}.{nameof(WhenCalledTwice_ThenThrowsObjectDisposedExceptionWithCallerInformation)}",
() => { });
subject.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() => subject.Dispose());

Assert.Contains(
ExpectedSubstring,
exception.Message.Replace(Path.PathSeparator, '/')
@"Fluxor.UnitTests\DisposableCallbackTests\DisposeTests.cs"" on line ",
exception.Message.Replace('/', '\\')
);
}
}

0 comments on commit 6d858b4

Please sign in to comment.