Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple difference not detected #111

Open
wexman opened this issue Dec 13, 2024 · 0 comments
Open

Simple difference not detected #111

wexman opened this issue Dec 13, 2024 · 0 comments

Comments

@wexman
Copy link

wexman commented Dec 13, 2024

Hi,
I have a simple use case here and unfortunately it doesn't work as expected. Here's a unit test that's failing although I think it shouldn't:

    using EntityChange;
    using NUnit.Framework;

    [TestFixture]
    public class DesiredStateChecks
    {
        public abstract class AbstractBase
        {
        }

        public class ConcreteClass: AbstractBase
        {
            public string SomeString { get; set; }
        }

        public class Consumer
        {
            public AbstractBase SomeProperty { get; set; }
        }
        
        [Test]
        public void Foo()
        {
            var obj1 = new Consumer()
            {
                SomeProperty = new ConcreteClass()
                {
                    SomeString = "Test1"
                }
            };
            var obj2 = new Consumer()
            {
                SomeProperty = new ConcreteClass()
                {
                    SomeString = "Test2" // that's a difference!
                }
            };

            var comparer = new EntityComparer();
            var result = comparer.Compare(obj1, obj2);
            Assert.That(result, Is.Not.Empty);
        }
    }

Am I using it wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant