Dummy class for unit testing purpose.
Наследование: Person
Пример #1
0
 public void InheritsFromWorksAlsoWithTheSameType()
 {
     var child = new Child { Name = "Telemachus" };
     Check.That(child).InheritsFrom<Child>();
 }
Пример #2
0
 public void WeCanSeeTheDifferenceBewteenTwoDifferentObjectsThatHaveTheSameToString()
 {
     Person dad = new Person { Name = "John" };
     Person son = new Child { Name = "John" };
     Check.That(son).IsEqualTo(dad);
 }
Пример #3
0
 public void InheritsFromWorks()
 {
     var child = new Child { Name = "Telemachus" };
     Check.That(child).InheritsFrom<Person>();
 }
Пример #4
0
 public void IsInstanceOfThrowsExceptionWithDerivedTypeAsCheckedExpression()
 {
     var child = new Child { Name = "Telemachus" };
     Check.That(child).IsInstanceOf<Person>();
 }
Пример #5
0
        public void IsInstanceOfThrowsExceptionWithDerivedTypeAsCheckedExpression()
        {
            var child = new Child { Name = "Telemachus" };

            Check.ThatCode(() =>
            {
                Check.That(child).IsInstanceOf<Person>();
            })
            .Throws<FluentCheckException>()
            .WithMessage(Environment.NewLine+ "The checked value is not an instance of the expected type." + Environment.NewLine + "The checked value:" + Environment.NewLine + "\t[Telemachus] of type: [NFluent.Tests.Child]" + Environment.NewLine + "The expected value:" + Environment.NewLine + "\tan instance of type: [NFluent.Tests.Person]");
        }
Пример #6
0
        public void WeCanSeeTheDifferenceBewteenTwoDifferentObjectsThatHaveTheSameToString()
        {
            Person dad = new Person { Name = "John" };
            Person son = new Child { Name = "John" };

            Check.ThatCode(() =>
            {
                Check.That(son).IsEqualTo(dad);
            })
            .Throws<FluentCheckException>()
            .WithMessage(Environment.NewLine+ "The checked value is different from the expected one." + Environment.NewLine + "The checked value:" + Environment.NewLine + "\t[John] of type: [NFluent.Tests.Child]" + Environment.NewLine + "The expected value:" + Environment.NewLine + "\t[John] of type: [NFluent.Tests.Person]");
        }
Пример #7
0
namespace NFluent.Tests