Beispiel #1
0
        internal static Apartment Apartment201()
        {
            var dwellers = new List <Dweller>();

            dwellers.Add(Dweller.FromId(
                             4,
                             "Fulano Santos",
                             new DateTime(1982, 04, 27),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));
            dwellers.Add(Dweller.FromId(
                             5,
                             "Beltrano Santos",
                             new DateTime(1980, 01, 01),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));
            dwellers.Add(Dweller.FromId(
                             6,
                             "Joaozinho Santos",
                             new DateTime(1980, 01, 01),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));

            return(Apartment.FromId(3, 201, "A", dwellers));
        }
        public void FromId()
        {
            var apartment = Apartment.FromId(1, 211, "B", DwellerList());

            Assert.Equal(1, apartment.Id);
            Assert.Equal(211, apartment.Number);
            Assert.Equal("B", apartment.Block);

            Assert.Collection <Apartment>(apartment.Dwellers.Select(p => p.Apartment), item => Assert.Equal(item, apartment), item => Assert.Equal(item, apartment));
        }
        public void UpdateData()
        {
            var apartment = Apartment.FromId(1, 211, "B", UpdateDwellerListOld());

            apartment.UpdateData(213, "C", UpdateDwellerListNew());
            Assert.Equal(1, apartment.Id);
            Assert.Equal(213, apartment.Number);
            Assert.Equal("C", apartment.Block);


            Assert.Contains("Marcelo Gerent", apartment.Dwellers.Select(p => p.Name));
            Assert.Contains("Huguinho Gerent", apartment.Dwellers.Select(p => p.Name));
        }
Beispiel #4
0
        internal static Apartment Apartment212()
        {
            var dwellers = new List <Dweller>();

            dwellers.Add(Dweller.FromId(
                             3,
                             "Ciclana da silva",
                             new DateTime(1982, 04, 27),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));
            return(Apartment.FromId(2, 212, "B", dwellers));
        }
Beispiel #5
0
        internal static Apartment Apartment211()
        {
            var dwellers = new List <Dweller>();

            dwellers.Add(Dweller.FromId(
                             1,
                             "Marcelo Gerent",
                             new DateTime(1982, 04, 27),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));
            dwellers.Add(Dweller.FromId(
                             2,
                             "Zezinho Gerent",
                             new DateTime(1980, 01, 01),
                             "(48) 99619-0445",
                             "123.456.789-09",
                             "*****@*****.**",
                             null));
            return(Apartment.FromId(1, 211, "B", dwellers));
        }