Exemple #1
0
            ) WorldWithAFlyingAnimal()
        {
            var solver = new SolverWorld();
            var flying = new Subject("African Swallow");

            flying.Traits.Add(new Trait("flies"));
            var b = new Subject("Penguin");
            var c = new Subject("Chicken");

            solver.Insert(flying);
            solver.Insert(b);
            solver.Insert(c);

            return(solver, flying, new[] { b, c });
        }
Exemple #2
0
        public void Query_WithSolver_ContainsFullWorld()
        {
            var solver = new SolverWorld();

            solver.Insert(new Subject("Chell"));
            solver.Insert(new Subject("P-body"));
            solver.Insert(new Subject("Atlas"));

            var query = new Query(solver.Subjects);

            Assert.AreEqual(
                query.Results.Union(solver.Subjects).Count(),
                3,
                "Subjects and ResultSet contain the same items"
                );
        }
        public void Insert_WithSubject_AddsSubjectToWorld()
        {
            var solver = new SolverWorld();

            solver.Insert(new Subject("Chell"));

            Assert.AreEqual(solver.Subjects.Count(), 1, "Subjects.Count() == 1");
        }
        public void Insert_WithoutSubject_Fails()
        {
            var solver = new SolverWorld();

            solver.Insert(null);
        }