Пример #1
0
        private void AddSpouse(string name, string spouseName)
        {
            var spousesPartner = _personLookupCache.GetPerson(name);

            if (spousesPartner != null)
            {
                var genderOfSpouse = spousesPartner.IsMale ? Gender.Female : Gender.Male;
                var spouse         = Person.Create(spouseName, genderOfSpouse);
                _personLookupCache.AddPerson(spouse);

                spousesPartner.SetSpouse(spouse);
            }
            else
            {
                throw new PersonUnknownException($"Person named {name} is unknown");
            }
        }
Пример #2
0
 private Person WhenAnUnknownPersonIsLookedup()
 {
     return(_personLookupCache.GetPerson("John"));
 }
Пример #3
0
 private Person WhenAPersonInTheCacheIsLookedup()
 {
     return(_personLookupCache.GetPerson("Jane"));
 }