Redouble.AspNet.Webpack.Test.WebpackServiceMock.AddNonExistantFile C# (CSharp) Méthode

AddNonExistantFile() public méthode

public AddNonExistantFile ( string filename ) : void
filename string
Résultat void
        public void AddNonExistantFile(string filename)
        {
            _files.Add(filename, null);
        }

Usage Example

        public async Task DevServer_Returns404WhenWebpackFileNotFound()
        {
            // Arrange
            var mock = new WebpackServiceMock();
            mock.AddNonExistantFile("/public/bundle.js");

            using (var server = CreateServer(mock))
            {
                // Act
                // Actual request.
                var response = await server.CreateRequest("/public/bundle.js").SendAsync("GET");

                // Assert
                Assert.Equal(System.Net.HttpStatusCode.NotFound, response.StatusCode);
            }
        }
All Usage Examples Of Redouble.AspNet.Webpack.Test.WebpackServiceMock::AddNonExistantFile