示例#1
0
        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);
        }
示例#2
0
        public async Task <Core.SystemInfo> GetSystemInfo()
        {
            GeneratedCode.SystemInfo systemInfo = await this.moduleManager.GetSystemInfoAsync();

            return(new Core.SystemInfo(systemInfo.OsType, systemInfo.Architecture, systemInfo.Version));
        }