public void Telemetry_common_properties_should_return_new_guid_when_cannot_get_mac_address() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingUserLevelCacheWriter()); var assignedMachineId = unitUnderTest.GetTelemetryCommonProperties()["Machine ID"]; Guid.TryParse(assignedMachineId, out var _).Should().BeTrue("it should be a guid"); }
public void TelemetryCommonPropertiesShouldContainEmptyLibcReleaseAndVersion() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Libc Release"].Should().BeEmpty(); unitUnderTest.GetTelemetryCommonProperties()["Libc Version"].Should().BeEmpty(); }
public void TelemetryCommonPropertiesShouldReturnNewGuidWhenCannotGetMacAddress() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); var assignedMachineId = unitUnderTest.GetTelemetryCommonProperties()["Machine ID"]; Guid.TryParse(assignedMachineId, out var _).Should().BeTrue("it should be a guid"); }
public void TelemetryCommonPropertiesShouldContainLibcReleaseAndVersion() { if (!RuntimeEnvironment.OperatingSystem.Contains("Alpine", StringComparison.OrdinalIgnoreCase)) { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Libc Release"].Should().NotBeEmpty(); unitUnderTest.GetTelemetryCommonProperties()["Libc Version"].Should().NotBeEmpty(); } }
public void TelemetryCommonPropertiesShouldContainEmptyWindowsProductType() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Product Type"].Should().BeEmpty(); }
public void TelemetryCommonPropertiesShouldContainKernelVersion() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Kernel Version"].Should().Be(RuntimeInformation.OSDescription); }
public void TelemetryCommonPropertiesShouldReturnIsOutputRedirected() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Output Redirected"].Should().BeOneOf("True", "False"); }
public void TelemetryCommonPropertiesShouldReturnHashedMachineId() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => "plaintext", userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Machine ID"].Should().NotBe("plaintext"); }
public void TelemetryCommonPropertiesShouldReturnHashedPath() { var unitUnderTest = new TelemetryCommonProperties(() => "ADirectory", userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Current Path Hash"].Should().NotBe("ADirectory"); }
public void TelemetryCommonPropertiesShouldContainIfItIsInDockerOrNot() { var unitUnderTest = new TelemetryCommonProperties(userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties().Should().ContainKey("Docker Container"); }
public void Telemetry_common_properties_should_return_hashed_machine_id() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => "plaintext", userLevelCacheWriter: new NothingUserLevelCacheWriter()); unitUnderTest.GetTelemetryCommonProperties()["Machine ID"].Should().NotBe("plaintext"); }
public void Telemetry_common_properties_should_contain_if_it_is_in_docker_or_not() { var unitUnderTest = new TelemetryCommonProperties(userLevelCacheWriter: new NothingUserLevelCacheWriter()); unitUnderTest.GetTelemetryCommonProperties().Should().ContainKey("Docker Container"); }
public void TelemetryCommonPropertiesShouldContainArchitectureInformation() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["OS Architecture"].Should().Be(RuntimeInformation.OSArchitecture.ToString()); }
public void TelemetryCommonPropertiesShouldReturnIsCIDetection() { var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); unitUnderTest.GetTelemetryCommonProperties()["Continuous Integration"].Should().BeOneOf("True", "False"); }
public void Telemetry_common_properties_should_contain_kernel_version() { var unitUnderTest = new TelemetryCommonProperties("product-version", getMACAddress: () => null, userLevelCacheWriter: new NothingUserLevelCacheWriter()); unitUnderTest.GetTelemetryCommonProperties()["Kernel Version"].Should().Be(RuntimeInformation.OSDescription); }