public void StaticWebAssetsFileProvider_FindsFileWithSpaces() { // Arrange & Act var provider = new StaticWebAssetsFileProvider("/_content", Path.Combine(AppContext.BaseDirectory, "testroot", "wwwroot")); // Assert Assert.True(provider.GetFileInfo("/_content/Static Web Assets.txt").Exists); }
public void GetFileInfo_Prefix_RespectsOsCaseSensitivity() { // Arrange var expectedResult = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); var provider = new StaticWebAssetsFileProvider( "_content", Path.GetDirectoryName(new Uri(typeof(StaticWebAssetsFileProviderTests).Assembly.CodeBase).LocalPath)); // Act var file = provider.GetFileInfo("/_CONTENT/Microsoft.AspNetCore.Hosting.StaticWebAssets.xml"); // Assert Assert.Equal(expectedResult, file.Exists); }
public void GetFileInfo_DoesNotMatch_IncompletePrefixSegments() { // Arrange var expectedResult = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); var provider = new StaticWebAssetsFileProvider( "_cont", Path.GetDirectoryName(new Uri(typeof(StaticWebAssetsFileProviderTests).Assembly.CodeBase).LocalPath)); // Act var file = provider.GetFileInfo("/_content/Microsoft.AspNetCore.TestHost.StaticWebAssets.xml"); // Assert Assert.False(file.Exists, "File exists"); }
public void GetFileInfo_Prefix_RespectsOsCaseSensitivity() { // Arrange var expectedResult = OperatingSystem.IsWindows(); var provider = new StaticWebAssetsFileProvider( "_content", Path.GetDirectoryName(typeof(StaticWebAssetsFileProviderTests).Assembly.Location)); // Act var file = provider.GetFileInfo("/_CONTENT/Microsoft.AspNetCore.Hosting.StaticWebAssets.xml"); // Assert Assert.Equal(expectedResult, file.Exists); }
public void GetFileInfo_DoesNotMatch_IncompletePrefixSegments() { // Arrange var expectedResult = OperatingSystem.IsWindows(); var provider = new StaticWebAssetsFileProvider( "_cont", Path.GetDirectoryName(typeof(StaticWebAssetsFileProviderTests).Assembly.Location)); // Act var file = provider.GetFileInfo("/_content/Microsoft.AspNetCore.TestHost.StaticWebAssets.xml"); // Assert Assert.False(file.Exists, "File exists"); }