In NUnit 3, they replaced the attribute "TestFixtureSetUp" with "OneTimeSetUp". However, in reality this does not work unless I am a complete idiot.
This is my code below:
[TestFixture] public class DiskServiceTests { private readonly Mock<IDriveInfoWrapper> _driveInfoWrapper = new Mock<IDriveInfoWrapper>(); private IDiskService _diskService; [OneTimeSetUp] public void Init() { _diskService = new DiskService(_driveInfoWrapper.Object); } [Test] public void GetDriveInfo_ShouldReturnDriveInfo() {
The test will start, but it never goes into Init (), so _diskService is null. Am I doing something wrong here, or could it be a mistake?
source share