public void TestSaveFamily()
        {
            var family = _familyDbService.GetFamily(555).Result;

            family.Father.Name.EnglishFather = "EFatherEnglish";
            family.Mother.Name.EnglishFather = "EFatherEnglish";
            if (family.Mother.Address != null)
            {
                family.Mother.Address.City   = "city";
                family.Mother.Address.Street = "street";
            }
            if (family.PrimaryAddress != null)
            {
                family.PrimaryAddress.City   = "city";
                family.PrimaryAddress.Street = "street";
            }
            if (family.AlternativeAddress != null)
            {
                family.AlternativeAddress.City   = "city";
                family.AlternativeAddress.Street = "street";
            }
            family.FinncialStatus = family.FinncialStatus + "_Test";
            var ret = _familyDbService.SaveFamily(family).Result;

            ret.ShouldBe(true);
            var newFamily = _familyDbService.GetFamily(555).Result;

            newFamily.Father.Name.EnglishFather.ShouldBe("EFatherEnglish");
            newFamily.Mother.Name.EnglishFather.ShouldBe("EFatherEnglish");
            if (family.PrimaryAddress != null)
            {
                family.PrimaryAddress.Street.ShouldBe("street");
            }
            if (family.AlternativeAddress != null)
            {
                family.AlternativeAddress.Street.ShouldBe("street");
            }
            family.FinncialStatus.EndsWith("_Test").ShouldBe(true);
        }
Beispiel #2
0
        public async Task <OrphanageDataModel.RegularData.Family> Get(int id)
        {
            if (id <= 0)
            {
                return(null);
            }
            var ret = await _FamilyDBService.GetFamily(id);

            if (ret == null)
            {
                throw new HttpResponseException(System.Net.HttpStatusCode.NotFound);
            }
            else
            {
                return(ret);
            }
        }