mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
add \0 string test
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using FreeSql.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -12,6 +12,26 @@ namespace FreeSql.Tests.Odbc.Default
|
||||
public class OdbcCodeFirstTest
|
||||
{
|
||||
|
||||
[Fact]
|
||||
public void Test_0String()
|
||||
{
|
||||
var fsql = g.odbc;
|
||||
fsql.Delete<test_0string01>().Where("1=1").ExecuteAffrows();
|
||||
|
||||
Assert.Equal(1, fsql.Insert(new test_0string01 { name = @"1.0000\0.0000\0.0000\0.0000\1.0000\0.0000" }).ExecuteAffrows());
|
||||
Assert.Equal(1, fsql.Insert(new test_0string01 { name = @"1.0000\0.0000\0.0000\0.0000\1.0000\0.0000" }).NoneParameter().ExecuteAffrows());
|
||||
|
||||
var list = fsql.Select<test_0string01>().ToList();
|
||||
Assert.Equal(2, list.Count);
|
||||
Assert.Equal(@"1.0000\0.0000\0.0000\0.0000\1.0000\0.0000", list[0].name);
|
||||
Assert.Equal(@"1.0000\0.0000\0.0000\0.0000\1.0000\0.0000", list[1].name);
|
||||
}
|
||||
class test_0string01
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
public string name { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void 中文表_字段()
|
||||
{
|
||||
|
Reference in New Issue
Block a user