コード例 #1
0
        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);
        }
コード例 #2
0
        public CollectionListTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

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

            Database = new Database(mongoDatabaseMock);
        }
コード例 #4
0
        public CollectionTests()
        {
            var mongoDatabaseMock = new Mocks.MongoDatabase("DATABASENAME");

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