Den obigen Testfall macht man nun erfüllbar, indem der zu testende Code geschrieben wird.
The above test case can now be fulfilled by writing the code to be tested.
Vor jedem Testdurchlauf wird der zu testende Code entsprechend gegebener Regeln verändert oder mutiert.
Before each test run, the code to be tested is modified or mutated.
Der zu testende Code befindet sich in den Zeilen 32 und 40.
The code to be tested is located in lines 32 and 40.
Dies wird jedoch mit einer Warnung angezeigt: Wenn der zu testende Code Navigationseigenschaften verwendet, die von den Fremdschlüsseln abhängen, schlägt er fehl.
This comes with a warning, though - if the code you are testing uses any navigation properties that depend on the foreign keys, it will fail.
Für diese Lösung muss der zu testende Code so vorbereitet werden, dass der Test die Ausführung der Vorgänge später im gleichen Thread wie der Test selber auslösen kann.
For this solution, the code under test has to be prepared in a way that the test can later directly trigger the execution of the operations on the same thread as test itself.
Unglücklicherweise kann der zu testende Code im manchen Fällen "async" und "await" nicht verwenden, etwa, wenn Sie Code testen, der bereits veröffentlicht wurde und aus Gründen fehlerhafter Änderung (Breaking Change) die Signatur der getesteten Methode nicht geändert werden kann.
Unfortunately, sometimes the code under test can't use async and await, such as when you're testing code that has already shipped and for breaking-change reasons the signature of the method being tested can't be changed.
Die Nachteile dieser Lösung sind, dass der Code im Humble Object selbst nicht getestet wird und der zu testende Code geändert werden muss.
The drawbacks of this solution are that the code in the Humble Object itself isn't tested and that the code under test has to be modified.
Ich glaube, der Aufruf von CreateTransient stellt eine Verbindung für Sie her, aber wenn der zu testende Code über Code verfügt, der irgendwo einen anderen dbContext erstellt, sucht Effort in der app.config nach diesen Informationen.
I believe the call to CreateTransient creates a connection for you, but if your code under test has code that creates another dbContext somewhere, Effort will look to the app.config to get that information.
Autres résultats
Diese Methode wird vor jedem Testfall ausgeführt und dient letztlich dazu, auf den zu testenden Code zu verweisen.
This method will be executed before each test case and its ultimate purpose is to reference the code under test.
Ein extrem sicherer, selbst-testender Code, der es nahezu unmöglich macht, die ausführbare Datei des Programms zu verändern.
A highly secure, self-testing code that makes it nearly impossible to modify the program's executable file.
Die Durchführung dieses Tests zeigt natürlich einen Fehler, der auf das Fehlen oder den Mangel des zu testenden Codes zurückzuführen ist.
Obviously, running this test will demonstrate a failure, due to the absence or deficiency of the code under test.
Du solltest nur das Verhalten dieser Klasse oder der kleinen Komponente des zu testenden Codes testen.
They should only test the behaviour of that class or of the small component of code under test.
Dies schränkt die Möglichkeiten von Tests ein, das ordnungsgemäße Fehlerverhalten des zu testenden Codes zu überprüfen.
This limits the ability of tests to check the correct error behavior of the code under test.
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.