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);
        }
Ejemplo n.º 2
0
        public CollectionListTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

            CollectionList = new CollectionList(mongoDatabaseMock);
        }
Ejemplo n.º 3
0
        public DatabaseTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

            Database = new Database(mongoDatabaseMock);
        }
Ejemplo n.º 4
0
        public CollectionTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

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