문제

I am using MSpec to drive my browser tests, but I keep forgetting to close the browser. Rather than put this cleanup in every context, can it be applied globally?

도움이 되었습니까?

해결책

A quote from the author in the only article I could find on the subject...

You can implement a ICleanupAfterEveryContextInAssembly to perform cleanup after every context (think cleaning up static state, resetting your ServerClock/DateTime replacement for example.

다른 팁

You can inherit specifications. Cleanup defined in the base specification class is invoked after all child cleanups.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top