<commit_before>﻿using System;
using Htc.Vita.Core.Util;
using Xunit;

namespace Htc.Vita.Core.Tests
{
    public partial class TestCase
    {
        [Fact]
        public void Registry_0_GetStringValue32_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue32_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue64_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue64_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
            Assert.Null(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_1_SetStringValue_UnderHKCU()
        {
            var valueName = Guid.NewGuid().ToString();
            var valueData = valueName;
            Registry.SetStringValue(Registry.Hive.CurrentUser, "SOFTWARE\\HTC\\Test", valueName, valueData);
            Assert.Equal(valueData, Registry.GetStringValue(Registry.Hive.CurrentUser, "SOFTWARE\\HTC\\Test", valueName));
        }

        [Fact(Skip = "AdministratorPermissionNeeded")]
        public void Registry_1_SetStringValue_UnderHKLM()
        {
            var valueName = Guid.NewGuid().ToString();
            var valueData = valueName;
            Registry.SetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\HTC\\Test", valueName, valueData);
            Assert.Equal(valueData, Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\HTC\\Test", valueName));
        }

        [Fact]
        public void Registry_2_DeleteValue32_UnderHKCU()
        {
            var valueName = "ffcc27a9-c3bb-463a-8716-3e2e5f2b85a1";
            var valueData = valueName;<commit_msg>Remove wrong assertion<commit_after>﻿using System;
using Htc.Vita.Core.Util;
using Xunit;

namespace Htc.Vita.Core.Tests
{
    public partial class TestCase
    {
        [Fact]
        public void Registry_0_GetStringValue32_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue32_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue32(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue64_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue64_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID", null));
            Assert.Null(Registry.GetStringValue64(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue_UnderHKCR()
        {
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, ".bat", null));
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "textfile\\shell\\open", null));
            Assert.Null(Registry.GetStringValue(Registry.Hive.ClassesRoot, "CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_0_GetStringValue_UnderHKLM()
        {
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}", null));
            Assert.NotNull(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel"));
            Assert.Null(Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\Classes\\CLSID\\{0000002F-0000-0000-C000-000000000046}\\InprocServer32", "ThreadingModel2"));
        }

        [Fact]
        public void Registry_1_SetStringValue_UnderHKCU()
        {
            var valueName = Guid.NewGuid().ToString();
            var valueData = valueName;
            Registry.SetStringValue(Registry.Hive.CurrentUser, "SOFTWARE\\HTC\\Test", valueName, valueData);
            Assert.Equal(valueData, Registry.GetStringValue(Registry.Hive.CurrentUser, "SOFTWARE\\HTC\\Test", valueName));
        }

        [Fact(Skip = "AdministratorPermissionNeeded")]
        public void Registry_1_SetStringValue_UnderHKLM()
        {
            var valueName = Guid.NewGuid().ToString();
            var valueData = valueName;
            Registry.SetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\HTC\\Test", valueName, valueData);
            Assert.Equal(valueData, Registry.GetStringValue(Registry.Hive.LocalMachine, "SOFTWARE\\HTC\\Test", valueName));
        }

        [Fact]
        public void Registry_2_DeleteValue32_UnderHKCU()
        {
            var valueName = "ffcc27a9-c3bb-463a-8716-3e2e5f2b85a1";
            var valueData = valueName;
{'fraction_non_alphanumeric': 0.13389846835564975, 'fraction_numerical': 0.10557749735092958, 'mean_word_length': 3.3972892842016096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 30, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5209319', 'n_tokens_mistral': 3846, 'n_tokens_neox': 3092, 'n_words': 305}