Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Jan 1, 2024
1 parent a048db0 commit 86e621d
Show file tree
Hide file tree
Showing 40 changed files with 440 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Audit()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Priority()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Role()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;

namespace MediatR.CommandQuery.EntityFrameworkCore.SqlServer.Tests.Data.Entities
{
public partial class SchemaVersions
{
public SchemaVersions()
{
#region Generated Constructor
#endregion
}

#region Generated Properties
public int Id { get; set; }

public string ScriptName { get; set; }

public DateTime Applied { get; set; }

#endregion

#region Generated Relationships
#endregion

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Status()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Task()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TaskExtended()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Tenant()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public User()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public UserLogin()

public string UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; }
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.DisplayOrder)
.IsRequired()
.HasColumnName("DisplayOrder")
.HasColumnType("int");
.HasColumnType("int")
.HasDefaultValue(0);

builder.Property(t => t.IsActive)
.IsRequired()
.HasColumnName("IsActive")
.HasColumnType("bit")
.HasDefaultValueSql("((1))");
.HasDefaultValue(true);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -71,10 +72,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;

namespace MediatR.CommandQuery.EntityFrameworkCore.SqlServer.Tests.Data.Mapping
{
public partial class SchemaVersionsMap
: IEntityTypeConfiguration<MediatR.CommandQuery.EntityFrameworkCore.SqlServer.Tests.Data.Entities.SchemaVersions>
{
public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<MediatR.CommandQuery.EntityFrameworkCore.SqlServer.Tests.Data.Entities.SchemaVersions> builder)
{
#region Generated Configure
// table
builder.ToTable("SchemaVersions", "dbo");

// key
builder.HasKey(t => t.Id);

// properties
builder.Property(t => t.Id)
.IsRequired()
.HasColumnName("Id")
.HasColumnType("int")
.ValueGeneratedOnAdd();

builder.Property(t => t.ScriptName)
.IsRequired()
.HasColumnName("ScriptName")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);

builder.Property(t => t.Applied)
.IsRequired()
.HasColumnName("Applied")
.HasColumnType("datetime");

// relationships
#endregion
}

#region Generated Constants
public readonly struct Table
{
public const string Schema = "dbo";
public const string Name = "SchemaVersions";
}

public readonly struct Columns
{
public const string Id = "Id";
public const string ScriptName = "ScriptName";
public const string Applied = "Applied";
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.DisplayOrder)
.IsRequired()
.HasColumnName("DisplayOrder")
.HasColumnType("int");
.HasColumnType("int")
.HasDefaultValue(0);

builder.Property(t => t.IsActive)
.IsRequired()
.HasColumnName("IsActive")
.HasColumnType("bit")
.HasDefaultValueSql("((1))");
.HasDefaultValue(true);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -71,10 +72,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsDeleted)
.IsRequired()
.HasColumnName("IsDeleted")
.HasColumnType("bit");
.HasColumnType("bit")
.HasDefaultValue(false);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -94,10 +95,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
.IsRequired()
.HasColumnName("IsActive")
.HasColumnType("bit")
.HasDefaultValueSql("((1))");
.HasDefaultValue(true);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -66,10 +66,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsSuccessful)
.IsRequired()
.HasColumnName("IsSuccessful")
.HasColumnType("bit");
.HasColumnType("bit")
.HasDefaultValue(false);

builder.Property(t => t.FailureMessage)
.HasColumnName("FailureMessage")
Expand Down Expand Up @@ -103,10 +104,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsEmailAddressConfirmed)
.IsRequired()
.HasColumnName("IsEmailAddressConfirmed")
.HasColumnType("bit");
.HasColumnType("bit")
.HasDefaultValue(false);

builder.Property(t => t.DisplayName)
.IsRequired()
Expand All @@ -57,12 +58,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.AccessFailedCount)
.IsRequired()
.HasColumnName("AccessFailedCount")
.HasColumnType("int");
.HasColumnType("int")
.HasDefaultValue(0);

builder.Property(t => t.LockoutEnabled)
.IsRequired()
.HasColumnName("LockoutEnabled")
.HasColumnType("bit");
.HasColumnType("bit")
.HasDefaultValue(false);

builder.Property(t => t.LockoutEnd)
.HasColumnName("LockoutEnd")
Expand All @@ -75,7 +78,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsDeleted)
.IsRequired()
.HasColumnName("IsDeleted")
.HasColumnType("bit");
.HasColumnType("bit")
.HasDefaultValue(false);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -101,10 +105,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
Expand Down
Loading

0 comments on commit 86e621d

Please sign in to comment.