﻿using System;
using System.Linq;
using Marten.Schema;
using Marten.Testing.Documents;
using Xunit;

namespace Marten.Testing.Bugs
{
    public class Bug_837_missing_func_mt_immutable_timestamp_when_initializing_with_new_Schema : IntegratedFixture
    {
        [Fact]
        public void missing_func_mt_immutable_timestamp_when_initializing_with_new_Schema()
        {
            var store = DocumentStore.For(_ =>
            {
                _.AutoCreateSchemaObjects = AutoCreate.All;
                _.DatabaseSchemaName = "other1";
                _.Connection(ConnectionSource.ConnectionString);
            });

            using (var session = store.OpenSession())
            {
                session.Query<Target>().FirstOrDefault(m => m.DateOffset > DateTimeOffset.Now);
            }
        }
    }
}

Add failing test for issue GH-837
Add failing test for issue GH-837
