public DocumentValidatorTests()
        {
            var testSchema = new Schema()
            {
                new Property { Name = "wrongType", Type = typeof(string) },
                new Property
                {
                    Name = "required",
                    Type = typeof(string),
                    Options = new ValidationOptions(required: true)
                },
                new Property
                {
                    Name = "unique",
                    Type = typeof(string),
                    Options = new ValidationOptions(unique: true)
                },
                new Property
                {
                    Name = "pattern",
                    Type = typeof(string),
                    Options = new ValidationOptions(pattern: "test")
                },
                new Property
                {
                    Name = "patternNotString",
                    Type = typeof(int),
                    Options = new ValidationOptions(pattern: "test")
                }
            };
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");
            var collection = new Collection("COLLECTIONNAME", mongoDatabaseMock);

            DocumentValidator = new DocumentValidator(testSchema, collection);
        }
        public CollectionListTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

            CollectionList = new CollectionList(mongoDatabaseMock);
        }
Example #3
0
        public DatabaseTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

            Database = new Database(mongoDatabaseMock);
        }
        public CollectionTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

            Collection = new Collection("COLLECTIONNAME", mongoDatabaseMock);
        }