Пример #1
0
        public void GenerateSingleObjectTest()
        {
            var person = Lie <Person> .Generate();

            person.Should().NotBeNull();
            person.Should().BeOfType <Person>();
        }
Пример #2
0
        public void GenerateTenObjectsTest()
        {
            var persons = Lie <Person> .Generate(10);

            persons.Should().NotBeNull();
            persons.Should().NotContainNulls();
            persons.Count.Should().Be(10);
            persons.Should().AllBeOfType <Person>();
        }
Пример #3
0
        public void GenerateTenObjectsWithSequenceTest()
        {
            var persons = Lie <Person> .Generate(10);

            persons.Should().NotBeNull();
            persons.Should().NotContainNulls();

            persons.Count
            .Should().Be(10);

            persons.Select(x => x.Age).Distinct().Count()
            .Should().Be(persons.Count);

            persons.Should().BeInAscendingOrder(p => p.Age);
        }