public void ShouldBeUnique()
        {
            DocExampleWriter.Document(() =>
            {
                var lisa = new Person() { Name = "Lisa" };
                var bart = new Person() { Name = "Bart" };
                var maggie = new Person() { Name = "Maggie" };
                var simpsonsKids = new List<Person>() { bart, lisa, maggie, maggie};

                simpsonsKids.ShouldBeUnique();
            }, _testOutputHelper);
        }
Exemplo n.º 2
0
        public void TestPutMany2()
        {
            using (var connection = CreateConnection())
                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreateMultiValueDictionary <int, string>("Values");
                    var ids1       = collection.PutMany(1, new[] { "a", "b" });
                    ids1.Should().HaveCount(2, "because we inserted 2 values");

                    var ids2 = collection.PutMany(2, new[] { "c", "d", "e" });
                    ids2.Should().HaveCount(3, "because we inserted 3 values");

                    var ids = new List <RowId>(ids1);
                    ids.AddRange(ids2);
                    ids.ShouldBeUnique();
                }
        }
Exemplo n.º 3
0
        public void TestPutMany6()
        {
            using (var connection = CreateConnection())
                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreatePoint2DCollection <string>("Values");
                    var ids1       = collection.PutMany(Point2D.Zero, new[] { "a", "b" });
                    ids1.Should().HaveCount(2, "because we inserted 2 values");

                    var ids2 = collection.PutMany(new Point2D(1, 1), new[] { "c", "d", "e" });
                    ids2.Should().HaveCount(3, "because we inserted 3 values");

                    var ids = new List <RowId>(ids1);
                    ids.AddRange(ids2);
                    ids.ShouldBeUnique();
                }
        }
Exemplo n.º 4
0
        public void ShouldBeUnique()
        {
            DocExampleWriter.Document(() =>
            {
                var lisa = new Person {
                    Name = "Lisa"
                };
                var bart = new Person {
                    Name = "Bart"
                };
                var maggie = new Person {
                    Name = "Maggie"
                };
                var simpsonsKids = new List <Person> {
                    bart, lisa, maggie, maggie
                };

                simpsonsKids.ShouldBeUnique();
            }, _testOutputHelper);
        }
Exemplo n.º 5
0
        public void TestPut3()
        {
            using (var connection = CreateConnection())
            {
                var ids = new List <RowId>();

                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreateMultiValueDictionary <int, string>("Values");
                    ids.Add(collection.Put(42, "A"));
                    ids.Add(collection.Put(42, "B"));
                }
                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreateMultiValueDictionary <int, string>("Values");
                    ids.Add(collection.Put(42, "C"));
                    ids.Add(collection.Put(42, "D"));
                }

                ids.ShouldBeUnique();
            }
        }
Exemplo n.º 6
0
        public void TestPut3()
        {
            using (var connection = CreateConnection())
            {
                var ids = new List <RowId>();

                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreatePoint2DCollection <string>("Values");
                    ids.Add(collection.Put(Point2D.Zero, "A"));
                    ids.Add(collection.Put(Point2D.Zero, "B"));
                }
                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreatePoint2DCollection <string>("Values");
                    ids.Add(collection.Put(Point2D.Zero, "C"));
                    ids.Add(collection.Put(Point2D.Zero, "D"));
                }

                ids.ShouldBeUnique();
            }
        }
Exemplo n.º 7
0
        public void TestPutManyMultipleSessions()
        {
            using (var connection = CreateConnection())
            {
                var ids = new List <RowId>();

                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreateBag <string>("Values");
                    ids.AddRange(collection.PutMany(new[] { "A", "B" }));
                    ids.Add(collection.Put("C"));
                }

                using (var db = CreateDatabase(connection))
                {
                    var collection = db.GetOrCreateBag <string>("Values");
                    ids.AddRange(collection.PutMany(new [] { "D", "E" }));
                    ids.Add(collection.Put("F"));
                }

                ids.ShouldBeUnique();
            }
        }
        public void GivenListOfBuilders_WhenCallingBuildListImplicitly_ThenAListOfUniqueObjectsShouldBeReturned()
        {
            List <StudentViewModel> objects = Builder <StudentViewModel> .CreateListOfSize(5);

            objects.ShouldBeUnique();
        }
Exemplo n.º 9
0
        public void GivenListOfBuilders_WhenCallingBuildListImplicitly_ThenAListOfUniqueEntitiesShouldBeReturned()
        {
            List <Customer> entities = BasicCustomerBuilder.CreateListOfSize(5);

            entities.ShouldBeUnique();
        }
        public void TwoPlayersShouldNotBeTheSame()
        {
            var player1 = new PlayerCharacter() {Name = "Faldar"};
            var player2 = new PlayerCharacter() { Name = "Faldar" };
            player2.Weapons.Add("Ring of Healing");
            var playerList = new List<PlayerCharacter>() {player1, player2};

            playerList.ShouldBeUnique();
        }