Represents dependency on one or more properties of a Project
Inheritance: DependenciesBase
        public void CreatesSameFingerprintForSameState()
        {
            var dep = new ProjectPropertiesDependencies(project, "Type");
            var fp1 = dep.CreateFingerprint();
            var fp2 = dep.CreateFingerprint();

            fp1.Should().Be(fp2);
            fp2.Should().Be(fp1);
        }
        public void ConvertToProtocolAndBack()
        {
            var dep = new ProjectPropertiesDependencies(project, "Type");
            var fp1 = dep.CreateFingerprint();

            var proto = fp1.Protocol;
            var fp2 = proto.CreateFingerprint();

            fp1.Should().Be(fp2);
        }
        public void ChangingThePropertyChangesTheFingerprint()
        {
            var dep = new ProjectPropertiesDependencies(project, "Type");
            var fp1 = dep.CreateFingerprint();

            project.Type = ProjectType.Executable;

            var fp2 = dep.CreateFingerprint();

            fp1.Should().NotBe(fp2);
        }
        public void SerializeAndReadBack()
        {
            var ser = new BinarySerializer();
            var dep = new ProjectPropertiesDependencies(project, "Type");
            var fp1 = dep.CreateFingerprint();

            byte[] data;
            using (var ms = new MemoryStream())
            {
                fp1.Save(ser, ms);
                data = ms.ToArray();
            }

            ObjectPropertiesFingerprint fp2;
            using (var ms = new MemoryStream(data))
            {
                fp2 = new ObjectPropertiesFingerprint(ser, ms);
            }

            fp1.Should().Be(fp2);
        }
        public void SerializeAndReadBack()
        {
            var registry = new DependencyFingerprintProtocolRegistry();
            registry.Register<ObjectPropertiesProtocol>();

            var ser = new BinarySerializer(registry);
            var dep = new ProjectPropertiesDependencies(project, "Type");
            var fp1 = dep.Fingerprint;

            byte[] data;
            using (var ms = new MemoryStream())
            {
                fp1.Save(ser, ms);
                data = ms.ToArray();
            }

            ObjectPropertiesFingerprint fp2;
            using (var ms = new MemoryStream(data))
            {
                fp2 = new ObjectPropertiesFingerprint(ser, ms);
            }

            fp1.Should().Be(fp2);
        }