@@ -39,7 +39,8 @@ public DefaultDocumentContextFactoryTest(ITestOutputHelper testOutput)
39
39
public void TryCreateAsync_CanNotResolveDocument_ReturnsNull ( )
40
40
{
41
41
// Arrange
42
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
42
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
43
+ var uri = new Uri ( filePath ) ;
43
44
var factory = new DefaultDocumentContextFactory ( _projectSnapshotManagerAccessor , new TestDocumentResolver ( ) , _documentVersionCache , LoggerFactory ) ;
44
45
45
46
// Act
@@ -53,7 +54,8 @@ public void TryCreateAsync_CanNotResolveDocument_ReturnsNull()
53
54
public void TryCreateForOpenDocumentAsync_CanNotResolveDocument_ReturnsNull ( )
54
55
{
55
56
// Arrange
56
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
57
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
58
+ var uri = new Uri ( filePath ) ;
57
59
var factory = new DefaultDocumentContextFactory ( _projectSnapshotManagerAccessor , new TestDocumentResolver ( ) , _documentVersionCache , LoggerFactory ) ;
58
60
59
61
// Act
@@ -67,7 +69,8 @@ public void TryCreateForOpenDocumentAsync_CanNotResolveDocument_ReturnsNull()
67
69
public void TryCreateForOpenDocumentAsync_CanNotResolveVersion_ReturnsNull ( )
68
70
{
69
71
// Arrange
70
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
72
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
73
+ var uri = new Uri ( filePath ) ;
71
74
var documentSnapshot = TestDocumentSnapshot . Create ( uri . GetAbsoluteOrUNCPath ( ) ) ;
72
75
var documentResolver = new TestDocumentResolver ( documentSnapshot ) ;
73
76
var factory = new DefaultDocumentContextFactory ( _projectSnapshotManagerAccessor , documentResolver , _documentVersionCache , LoggerFactory ) ;
@@ -83,7 +86,8 @@ public void TryCreateForOpenDocumentAsync_CanNotResolveVersion_ReturnsNull()
83
86
public void TryCreateAsync_ResolvesContent ( )
84
87
{
85
88
// Arrange
86
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
89
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
90
+ var uri = new Uri ( filePath ) ;
87
91
var documentSnapshot = TestDocumentSnapshot . Create ( uri . GetAbsoluteOrUNCPath ( ) ) ;
88
92
var codeDocument = RazorCodeDocument . Create ( RazorSourceDocument . Create ( string . Empty , documentSnapshot . FilePath ) ) ;
89
93
documentSnapshot . With ( codeDocument ) ;
@@ -103,7 +107,8 @@ public void TryCreateAsync_ResolvesContent()
103
107
public void TryCreateAsync_WithProjectContext_Resolves ( )
104
108
{
105
109
// Arrange
106
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
110
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
111
+ var uri = new Uri ( filePath ) ;
107
112
var documentSnapshot = TestDocumentSnapshot . Create ( uri . GetAbsoluteOrUNCPath ( ) ) ;
108
113
var codeDocument = RazorCodeDocument . Create ( RazorSourceDocument . Create ( string . Empty , documentSnapshot . FilePath ) ) ;
109
114
documentSnapshot . With ( codeDocument ) ;
@@ -129,7 +134,8 @@ public void TryCreateAsync_WithProjectContext_Resolves()
129
134
public void TryCreateAsync_WithProjectContext_DoesntUseSnapshotResolver ( )
130
135
{
131
136
// Arrange
132
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
137
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
138
+ var uri = new Uri ( filePath ) ;
133
139
var documentSnapshot = TestDocumentSnapshot . Create ( uri . GetAbsoluteOrUNCPath ( ) ) ;
134
140
var codeDocument = RazorCodeDocument . Create ( RazorSourceDocument . Create ( string . Empty , documentSnapshot . FilePath ) ) ;
135
141
documentSnapshot . With ( codeDocument ) ;
@@ -156,7 +162,8 @@ public void TryCreateAsync_WithProjectContext_DoesntUseSnapshotResolver()
156
162
public async Task TryCreateForOpenDocumentAsync_ResolvesContent ( )
157
163
{
158
164
// Arrange
159
- var uri = new Uri ( "C:/path/to/file.cshtml" ) ;
165
+ var filePath = PathUtilities . CreateRootedPath ( "path" , "to" , "file.cshtml" ) ;
166
+ var uri = new Uri ( filePath ) ;
160
167
var documentSnapshot = TestDocumentSnapshot . Create ( uri . GetAbsoluteOrUNCPath ( ) ) ;
161
168
var codeDocument = RazorCodeDocument . Create ( RazorSourceDocument . Create ( string . Empty , documentSnapshot . FilePath ) ) ;
162
169
documentSnapshot . With ( codeDocument ) ;
0 commit comments