Skip to content

Commit 710d606

Browse files
committed
Avoids situations where there is no changes
1 parent d2fa5e2 commit 710d606

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/HodStudio.EntityFrameworkDiffLog.TestsDotNet45/IdGeneratedByApp/IdGeneratedByAppBaseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected virtual Department CreateDepartment()
1717
=> new Department()
1818
{
1919
Code = Guid.NewGuid(),
20-
Budget = DateTime.Now.Millisecond - (new Random()).Next(0, 100)
20+
Budget = DateTime.Now.Ticks
2121
};
2222

2323
protected virtual Department PrepareDepartment()
@@ -50,7 +50,7 @@ protected virtual void ValidateLog(Department department)
5050
var currentLog = GetLog(department);
5151
Assert.IsNotNull(currentLog);
5252

53-
var expected = string.Format("{{\"Id\":[\"{0}\"],\"Code\":[\"{2}\"],\"Budget\":[{1:N1}]}}",
53+
var expected = string.Format("{{\"Id\":[\"{0}\"],\"Code\":[\"{2}\"],\"Budget\":[{1}]}}",
5454
department.Id, department.Budget, department.Code);
5555
Assert.AreEqual(expected, currentLog.ValuesChanges);
5656
}

src/HodStudio.EntityFrameworkDiffLog.TestsDotNet45/IdGeneratedByApp/UpdateOperationsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected void Validate(Department original, Department updated)
3232
var currentLog = GetLog(updated);
3333
Assert.IsNotNull(currentLog);
3434

35-
var expected = string.Format("{{\"Code\":[\"{2}\",\"{3}\"],\"Budget\":[{0:N1},{1:N1}]}}",
35+
var expected = string.Format("{{\"Code\":[\"{2}\",\"{3}\"],\"Budget\":[{0},{1}]}}",
3636
original.Budget, updated.Budget,
3737
original.Code, updated.Code);
3838
Assert.AreEqual(expected, currentLog.ValuesChanges);

src/HodStudio.EntityFrameworkDiffLog.TestsDotNet45/Model/Department.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ public class Department
88
{
99
public Guid Id { get; set; } = Guid.NewGuid();
1010
public Guid Code { get; set; }
11-
public decimal Budget { get; set; }
11+
public long Budget { get; set; }
1212
}
1313
}

0 commit comments

Comments
 (0)