A dependency implementation representing no dependency
Inheritance: DependenciesBase
コード例 #1
0
ファイル: NoDependenciesTest.cs プロジェクト: vigoo/bari
        public void HasNoProtocol()
        {
            var dep = new NoDependencies();
            var fp1 = dep.Fingerprint;

            var proto = fp1.Protocol;
            proto.Should().BeNull();
        }
コード例 #2
0
ファイル: NoDependenciesTest.cs プロジェクト: vigoo/bari
        public void NoDependenciesMakesEqualFingerprints()
        {
            var dep1 = new NoDependencies();
            var dep2 = new NoDependencies();

            var fp1 = dep1.Fingerprint;
            var fp2 = dep2.Fingerprint;

            fp1.Should().Be(fp2);
            fp2.Should().Be(fp1);
            fp1.Equals(fp2).Should().BeTrue();
        }
コード例 #3
0
        /// <summary>
        /// Creates the fingerprint by its deserialized protocol data
        /// </summary>
        /// <param name="proto">The deserialized protocol data</param>
        public CombinedFingerprint(CombinedFingerprintProtocol proto)
        {
            fingerprints = new HashSet <IDependencyFingerprint>();
            var noDeps   = new NoDependencies();
            var noDepsFp = noDeps.Fingerprint;

            foreach (var childProtocol in proto.Items)
            {
                var childDependencyFingerprint = childProtocol != null?childProtocol.CreateFingerprint() : noDepsFp;

                fingerprints.Add(childDependencyFingerprint);
            }
        }