<commit_before>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using ObjectFiller.Test.TestPoco.Person;
using Tynamix.ObjectFiller;

namespace ObjectFiller.Test
{
    [TestClass]
    public class AddressFillingTest
    {
        [TestMethod]
        public void FillAllAddressProperties()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            Address a = addressFiller.Fill();

            Assert.IsNotNull(a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void IgnoreCountry()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                    .OnProperty(x=>x.Country).IgnoreIt();
            Address a = addressFiller.Fill();

            Assert.IsNotNull(a.City);
            Assert.IsNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void IgnoreCountryAndCity()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(x => x.Country, x => x.City).IgnoreIt();
            Address a = addressFiller.Fill();

            Assert.IsNull(a.City);
            Assert.IsNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void SetupCityPropertyWithConstantValue()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(ad => ad.City).Use(() => "City");
            Address a = addressFiller.Fill();

            Assert.AreEqual("City", a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void SetupCityAndCountryPropertyWithConstantValue()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(ad => ad.City, ad => ad.Country).Use(() => "CityCountry");
            Address a = addressFiller.Fill();

            Assert.AreEqual("CityCountry", a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);<commit_msg>Update AddressFillingTest.cs<commit_after>using Microsoft.VisualStudio.TestTools.UnitTesting;
using ObjectFiller.Test.TestPoco.Person;
using Tynamix.ObjectFiller;

namespace ObjectFiller.Test
{
    [TestClass]
    public class AddressFillingTest
    {
        [TestMethod]
        public void FillAllAddressProperties()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            Address a = addressFiller.Create();

            Assert.IsNotNull(a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void IgnoreCountry()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                    .OnProperty(x=>x.Country).IgnoreIt();
            Address a = addressFiller.Create();

            Assert.IsNotNull(a.City);
            Assert.IsNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void IgnoreCountryAndCity()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(x => x.Country, x => x.City).IgnoreIt();
            Address a = addressFiller.Create();

            Assert.IsNull(a.City);
            Assert.IsNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void SetupCityPropertyWithConstantValue()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(ad => ad.City).Use(() => "City");
            Address a = addressFiller.Create();

            Assert.AreEqual("City", a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
            Assert.IsNotNull(a.Street);
        }

        [TestMethod]
        public void SetupCityAndCountryPropertyWithConstantValue()
        {
            Filler<Address> addressFiller = new Filler<Address>();
            addressFiller.Setup()
                .OnProperty(ad => ad.City, ad => ad.Country).Use(() => "CityCountry");
            Address a = addressFiller.Create();

            Assert.AreEqual("CityCountry", a.City);
            Assert.IsNotNull(a.Country);
            Assert.AreNotEqual(0, a.HouseNumber);
            Assert.IsNotNull(a.PostalCode);
{'fraction_non_alphanumeric': 0.11630474788369526, 'fraction_numerical': 0.001840264998159735, 'mean_word_length': 1.9521998913633896, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 39, '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': '961184', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1465, 'n_words': 230}