Exemple #1
0
        public void CopyPossibleResult()
        {
            int givenValue = 25;
            var theResult  = new PossibleResult(givenValue);
            var myOutcome1 = new ChangeInTrust(1, new Role("one"), new Role("two"), "myOutcome1");
            var myOutcome2 = new ChangeInTrust(1, new Role("two"), new Role("one"), "myOutcome2");

            theResult.TheOutcomes.Add(myOutcome1);
            theResult.TheOutcomes.Add(myOutcome2);

            var altRole1        = new Role("three");
            var altRole2        = new Role("four");
            var replacementList = new List <Role>(2)
            {
                altRole1, altRole2
            };

            var theCopy = theResult.Copy(replacementList);

            Assert.AreEqual(theResult.ProbabilityScore, theCopy.ProbabilityScore);
            Assert.AreEqual(theResult.TheOutcomes.Count, theCopy.TheOutcomes.Count);

            var copyOutcome1 = theCopy.TheOutcomes.First() as ChangeInTrust;

            Assert.AreEqual(myOutcome1.OutcomeName, copyOutcome1.OutcomeName);
            Assert.AreEqual(myOutcome1.Magnitude, copyOutcome1.Magnitude);
            Assert.AreNotEqual(myOutcome1.BeingChanged, copyOutcome1.BeingChanged);
            Assert.AreNotEqual(myOutcome1.Towards, copyOutcome1.Towards);
        }
Exemple #2
0
        public void TestInitialize()
        {
            int givenMagnitude = 3;
            var role1          = new Role("r1");
            var role2          = new Role("r2");

            theOutcome = new ChangeInTrust(givenMagnitude, role1, role2, "testOutcome");

            Assert.AreEqual(givenMagnitude, theOutcome.Magnitude);
            Assert.IsNotNull(theOutcome.BeingChanged);
            Assert.AreEqual(role1, theOutcome.BeingChanged);
            Assert.IsNotNull(theOutcome.Towards);
        }