コード例 #1
0
        public void IsDivorcedFrom_ReturnsFalseForNonWife()
        {
            var p1 = new FamilyMember("Tom", Gender.Male);
            var p2 = new FamilyMember("Nancy", Gender.Female);

            Assert.IsFalse(p1.IsDivorcedFrom(p2));
        }
コード例 #2
0
        public void IsDivorcedFrom_ReturnsFalseForCurrentWife()
        {
            var p1 = new FamilyMember("Tom", Gender.Male);
            var p2 = new FamilyMember("Nancy", Gender.Female);

            new Partnership(p1, p2);

            Assert.IsFalse(p1.IsDivorcedFrom(p2));
        }
コード例 #3
0
        public void IsDivorcedFrom_ReturnsTrueForExWife()
        {
            var p1          = new FamilyMember("Tom", Gender.Male);
            var p2          = new FamilyMember("Nancy", Gender.Female);
            var partnership = new Partnership(p1, p2);

            partnership.IsDivorced = true;

            Assert.IsTrue(p1.IsDivorcedFrom(p2));
        }