<commit_before>﻿//
// Copyright (c) XSharp B.V.  All Rights Reserved.  
// Licensed under the Apache License, Version 2.0.  
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit


// Array tests are not working correctly yet with the current build
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS EmptyTests
        [Fact, Trait("Category", "Empty Class")];
		METHOD EmptyClasstests() AS VOID
            local o as Object
            o := XSharp.VFP.Empty{}
            Assert.Throws( typeof(XSharp.Error), { => o:NonExistingProperty := 123 })
            try
                o:NonExistingProperty := 123 
            catch e as exception
                ? e
            end try
            AddProperty(o, "SomeProperty", 42)
            Assert.True( (Int) o:SomeProperty  == 42)
            AddProperty(o, "BestLanguage","X#")
            Assert.True( (string) o:BestLanguage  == "X#")
            RemoveProperty(o, "BestLanguage")
            Assert.True( (LOGIC) o:BestLanguage  == FALSE)
    END CLASS
END NAMESPACE<commit_msg>[VFP Test] Adjusted test because after calling RemoveProperty() a runtime error should be generated when accessing the property<commit_after>﻿//
// Copyright (c) <NAME>.V.  All Rights Reserved.  
// Licensed under the Apache License, Version 2.0.  
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit


// Array tests are not working correctly yet with the current build
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS EmptyTests
        [Fact, Trait("Category", "Empty Class")];
		METHOD EmptyClasstests() AS VOID
            local o as Object
            o := XSharp.VFP.Empty{}
            Assert.Throws( typeof(XSharp.Error), { => o:NonExistingProperty := 123 })
            try
                o:NonExistingProperty := 123 
            catch e as exception
                ? e
            end try
            AddProperty(o, "SomeProperty", 42)
            Assert.True( (Int) o:SomeProperty  == 42)
            AddProperty(o, "BestLanguage","X#")
            Assert.True( (string) o:BestLanguage  == "X#")
            RemoveProperty(o, "BestLanguage")
            Assert.Throws( typeof(XSharp.Error), { => o:BestLanguage  == FALSE})
    END CLASS
END NAMESPACE
{'fraction_non_alphanumeric': 0.10175145954962468, 'fraction_numerical': 0.010008340283569641, 'mean_word_length': 2.3319444444444444, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '7376984', 'n_tokens_mistral': 715, 'n_tokens_neox': 665, 'n_words': 217}