コード例 #1
0
        public void GetDefaultValue_ShouldReturnCurrentUserValue()
        {
            // Prepare
            const int userValue = 42;

            // Execute
            _gSettings.SetInt("test-int", userValue);
            var gvUserValue    = _gSettings.GetUserValue("test-int");
            var userFinalValue = gvUserValue.GetInt();
            var gvDefaultValue = _gSettings.GetDefaultValue("test-int");
            var defaultValue   = gvDefaultValue.GetInt();

            // Validate
            Assert.NotEqual(userFinalValue, defaultValue);
            Assert.Equal(50, defaultValue);
            Assert.Equal(userValue, userFinalValue);
            // Reset the value for next tests
            _gSettings.Reset("test-int");
        }