Ejemplo n.º 1
0
        public void SetAge()
        {
            using (PersonInfo info = new PersonInfo("David", 12))
            {
                Assert.Equal(12, info.Age());
                Assert.True(info.IsMinor());

                info.SetAge(22);
                Assert.Equal(22, info.Age());
                Assert.False(info.IsMinor());
            }
        }
Ejemplo n.º 2
0
 public void CreatePersonInfo()
 {
     using (PersonInfo info = new PersonInfo("David", 12))
     {
         Assert.Equal("David", info.Name());
         Assert.Equal(12, info.Age());
     }
 }
Ejemplo n.º 3
0
 public void SetAgeRepeated()
 {
     using (PersonInfo info = new PersonInfo("David", 12))
     {
         for (var age = 0; age < 100_000; age += 1)
         {
             info.SetAge(age);
             Assert.Equal(age, info.Age());
         }
     }
 }