public async Task GetSystemInfoTest() { // Arrange var systemInfoSample = new GeneratedCode.SystemInfo(); systemInfoSample.OsType = "linux"; systemInfoSample.Architecture = "x86"; var moduleManager = Mock.Of <IModuleManager>(m => m.GetSystemInfoAsync() == Task.FromResult(systemInfoSample)); IRuntimeInfoProvider runtimeInfoProvider = new RuntimeInfoProvider <TestConfig>(moduleManager); // Act Core.SystemInfo systemInfo = await runtimeInfoProvider.GetSystemInfo(); // Assert Assert.NotNull(systemInfo); Assert.Equal("linux", systemInfo.OperatingSystemType); Assert.Equal("x86", systemInfo.Architecture); }
public async Task <Core.SystemInfo> GetSystemInfo() { GeneratedCode.SystemInfo systemInfo = await this.moduleManager.GetSystemInfoAsync(); return(new Core.SystemInfo(systemInfo.OsType, systemInfo.Architecture, systemInfo.Version)); }