Example #1
0
 public void Nullable_Types_Are_Not_Nullable()
 {
     // Some examples of nullable types are: objects, strings and nullable value types.
     var dog = new Dog();
     var text = string.Empty;
     var i = (int?)5;
     DateTime? date = null;
     Weather? weather = null;
     Assert.IsTrue(dog.IsNullableType() && text.IsNullableType() && i.IsNullableType() && date.IsNullableType() && weather.IsNullableType());
 }
Example #2
0
        public void RemoveItem__A_Complex_Object_With_Simple_Properties_Can_Be_Removed_From_A_List()
        {
            var list = TestingHelpers.CreateAnimalsList();
            var dog = new Dog
            {
                Name = "Ruffles",
                Breed = "Golden Retriever",
                Color = "Gold"
            };

            list.RemoveItem(dog);

            var dogRemoved = list.All(l => l.GetType() != typeof (Dog));
            Assert.IsTrue(dogRemoved);
        }
Example #3
0
 public void Value_Types_Are_Detected()
 {
     var dog = new Dog();
     var text = string.Empty;
     Assert.IsTrue(dog.IsReferenceType() && text.IsReferenceType());
 }