Comments (4)
Those Add*
methods are part of the Microsoft.Extensions.DependencyInjection
namespace. Let me update the release notes to make it clear you need to add that now.
Import that in your .cs or .razor file and you are good to go:
using Microsoft.Extensions.DependencyInjection;
from bunit.
Please expose a property that will return the IServiceCollection.
I am not sure why there is a need for an explicit IServiceCollection
to be exposed. Due to inheritance, the TestServiceProvider
is one, so it should not be needed. See my coding example in the related issue (#38)
from bunit.
I am still getting:
Severity Code Description Project File Line Suppression State
Error CS1061 'TestServiceProvider' does not contain a definition for 'AddService' and no accessible extension method 'AddService'
from bunit.
Thats because there is no AddService any more. You need to call AddSingleton now, which is an extension method from Microsoft.Extensions.DependencyInjection.
Before beta-5, TestServiceProvider was not a true IServiceCollection, thus it implemented a bunch of AddServices methods. That is now changed, and we rely on the from extension method from Microsoft.Extensions.DependencyInjection.
I am sorry if that was not clear enough in the release notes
from bunit.
Related Issues (20)
- bunit.web has dependency on alpha version of AngleSharp.Css HOT 2
- No way to set value for property with `[SupplyParameterFromQuery]` but not `[Parameter]` HOT 6
- Support for keyed services HOT 5
- Cannot trigger RowSelected eventcallback on SFgrid HOT 3
- `WrapperElementsGenerator` cachable
- IJSUnmarshalledRuntime removed in .NET 9 HOT 2
- FakeNavigationManager registration changed from Singleton to Scoped HOT 7
- bUnit does not set parameters as a result of two-way binding or chained binding when values are updated. HOT 6
- `@formname` attribute always causes an error: System.InvalidOperationException : Invalid element frame type 'NamedEvent' HOT 2
- upgrading bUnit to 1.27.17 results in bunit.web.testcomponents load errors HOT 2
- WASM MSAL Configuration Not Correctly Supported HOT 1
- Async Task in Multiple Tests HOT 8
- Clicking an Anchor Tag does not update NavigationManager HOT 2
- Unable to resolve service for type 'Bunit.Rendering.ITestRenderer' HOT 4
- diff:ignoreChildren does not Ignore Children of a Button HOT 4
- Change in 1.27.12-preview breaks Moq/AutoMock with loose behavior HOT 5
- Documentation: Footer displays placeholders HOT 1
- BUnitBrowserFile ignores MaximumAllowedFileSize HOT 8
- BrowserFileExtensions.RequestImageFileAsync broken with bUnit 1.30.3 HOT 4
- Investigate if `BrowserFile` should be used instead bUnit's own `BunitBrowserFile` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bunit.