コード例 #1
0
 public void MysqlExtractMillisecondTest()
 {
     Require.ProviderIs(StorageProvider.MySql);
     ExecuteInsideSession(() => {
         var firstMillisecondDateTime = FirstMillisecondDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
         RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Millisecond == firstMillisecondDateTime.Millisecond);
         RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Second == WrongMillisecondDateTime.Millisecond);
     });
 }
コード例 #2
0
        public void MysqlMinisDateTimeTest()
        {
            Require.ProviderIs(StorageProvider.MySql);
            ExecuteInsideSession(() => {
                var firstDateTime            = FirstDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var firstMillisecondDateTime = FirstMillisecondDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var secondDateTime           = SecondDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var nullableDateTime         = NullableDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);

                RunTest <SingleDateTimeEntity>(c => c.DateTime - secondDateTime == firstDateTime - secondDateTime);
                RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime - secondDateTime == firstMillisecondDateTime - secondDateTime);
                RunTest <SingleDateTimeEntity>(c => c.NullableDateTime - secondDateTime == nullableDateTime - secondDateTime);

                RunWrongTest <SingleDateTimeEntity>(c => c.DateTime - secondDateTime == firstDateTime - WrongDateTime);
                RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime - secondDateTime == firstMillisecondDateTime - WrongDateTime);
                RunWrongTest <SingleDateTimeEntity>(c => c.NullableDateTime - secondDateTime == nullableDateTime - WrongDateTime);
            });
        }