Skip to content

Commit 9ab90c4

Browse files
committed
add test code #984
1 parent 3837afa commit 9ab90c4

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

FreeSql.Tests/FreeSql.Tests/Issues/592.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ public class _592
1717
[Fact]
1818
public void AdoNet()
1919
{
20-
using (var conn = g.mysql.Ado.MasterPool.Get())
20+
var fsql = g.mysql;
21+
fsql.Select<park_sys_users, park_sys_userrole>();
22+
23+
using (var conn = fsql.Ado.MasterPool.Get())
2124
{
2225
var list = conn.Value.Select<park_sys_users, park_sys_userrole>()
2326
.LeftJoin((rs, le) => rs.user_id == le.ur_userid)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using FreeSql.DataAnnotations;
2+
using Newtonsoft.Json;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.ComponentModel;
6+
using System.ComponentModel.DataAnnotations;
7+
using System.Diagnostics;
8+
using System.Reflection;
9+
using System.Text;
10+
using System.Threading;
11+
using Xunit;
12+
13+
namespace FreeSql.Tests.Issues
14+
{
15+
public class _594
16+
{
17+
[Fact]
18+
public void Decimal()
19+
{
20+
var fsql = g.sqlserver;
21+
22+
fsql.Delete<ts_decimal_18_4>().Where("1=1").ExecuteAffrows();
23+
var id = Guid.NewGuid();
24+
25+
Assert.Equal(1, fsql.Insert(new ts_decimal_18_4 { id = id }).ExecuteAffrows());
26+
Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id)
27+
.Set(a => a.price, 698830024.6700m)
28+
.ExecuteAffrows());
29+
30+
Assert.Equal(1, fsql.Update<ts_decimal_18_4>()
31+
.SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m })
32+
.ExecuteAffrows());
33+
34+
Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id).NoneParameter()
35+
.Set(a => a.price, 698830024.6700m)
36+
.ExecuteAffrows());
37+
38+
Assert.Equal(1, fsql.Update<ts_decimal_18_4>().NoneParameter()
39+
.SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m })
40+
.ExecuteAffrows());
41+
}
42+
43+
class ts_decimal_18_4
44+
{
45+
public Guid id { get; set; }
46+
[Column(Precision = 18, Scale = 4)]
47+
public decimal price { get; set; }
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)