Example #1
0
        public void Constructor_Always_SetsRuleToPassedInValue()
        {
            // Arrange
            InOutRule expectedRule = InOutRule.Open;

            // Act
            Turn subject = new Turn(expectedRule);

            // Assert
            Assert.AreEqual(expectedRule, subject.Rule, "Rule was not the expected value");
        }
        public void RuleProperty_Always_ReturnsWhatWasPassedIntoConstructor()
        {
            // Arrange
            InOutRule expectedRule = InOutRule.Open;

            // Act
            OutCalculator subject = new OutCalculator(expectedRule);

            // Assert
            Assert.AreEqual(expectedRule, subject.Rule, "Rule was not the expected value");
        }
Example #3
0
 /// <summary>
 /// Creates an instance of the OutCalculator
 /// </summary>
 /// <param name="outRule">Indicates the out rule to use to determine appropriate outs</param>
 public OutCalculator(InOutRule outRule)
 {
     Rule = outRule;
 }
Example #4
0
 /// <summary>
 /// Constructor to allow for setting of the InOutRule during initialization.
 /// </summary>
 /// <param name="rule">The Out rule to follow for calculations.</param>
 public Turn(InOutRule rule)
 {
     Rule = rule;
 }