-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added initial lookup tests port to MVC6.
- Loading branch information
1 parent
fab3e35
commit 7ef0611
Showing
30 changed files
with
2,761 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>3e245f3e-d204-43fb-9fd9-dd501ea8054d</ProjectGuid> | ||
<RootNamespace>Mvc.Lookup.Tests</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
</ItemGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Microsoft.Data.Entity; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects.Data | ||
{ | ||
public class Context : DbContext | ||
{ | ||
public DbSet<TestModel> TestModels { get; set; } | ||
public DbSet<TestRelationModel> TestRelationModels { get; set; } | ||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
{ | ||
optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Mvc6LookupTest;Trusted_Connection=True;MultipleActiveResultSets=True"); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
test/Mvc.Lookup.Tests/Objects/Data/Migrations/20151205110229_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
test/Mvc.Lookup.Tests/Objects/Data/Migrations/20151205110229_Initial.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Microsoft.Data.Entity.Migrations; | ||
using System; | ||
|
||
namespace Mvc.Lookup.Tests.Objects.Data.Migrations | ||
{ | ||
public partial class Initial : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "TestRelationModel", | ||
columns: table => new | ||
{ | ||
Id = table.Column<string>(nullable: false), | ||
NoValue = table.Column<string>(nullable: true), | ||
Value = table.Column<string>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_TestRelationModel", x => x.Id); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "TestModel", | ||
columns: table => new | ||
{ | ||
Id = table.Column<string>(nullable: false), | ||
CreationDate = table.Column<DateTime>(nullable: false), | ||
FirstRelationModelId = table.Column<string>(nullable: true), | ||
NullableString = table.Column<string>(nullable: true), | ||
Number = table.Column<int>(nullable: false), | ||
ParentId = table.Column<string>(nullable: true), | ||
SecondRelationModelId = table.Column<string>(nullable: true), | ||
Sum = table.Column<decimal>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_TestModel", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_TestModel_TestRelationModel_FirstRelationModelId", | ||
column: x => x.FirstRelationModelId, | ||
principalTable: "TestRelationModel", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Restrict); | ||
table.ForeignKey( | ||
name: "FK_TestModel_TestRelationModel_SecondRelationModelId", | ||
column: x => x.SecondRelationModelId, | ||
principalTable: "TestRelationModel", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable("TestModel"); | ||
migrationBuilder.DropTable("TestRelationModel"); | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
test/Mvc.Lookup.Tests/Objects/Data/Migrations/ContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using Microsoft.Data.Entity; | ||
using Microsoft.Data.Entity.Infrastructure; | ||
using Microsoft.Data.Entity.Metadata; | ||
using Microsoft.Data.Entity.Migrations; | ||
using NonFactors.Mvc.Lookup.Tests.Objects.Data; | ||
|
||
namespace Mvc.Lookup.Tests.Objects.Data.Migrations | ||
{ | ||
[DbContext(typeof(Context))] | ||
partial class ContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348"); | ||
|
||
modelBuilder.Entity("NonFactors.Mvc.Lookup.Tests.Objects.TestModel", b => | ||
{ | ||
b.Property<string>("Id"); | ||
|
||
b.Property<DateTime>("CreationDate"); | ||
|
||
b.Property<string>("FirstRelationModelId"); | ||
|
||
b.Property<string>("NullableString"); | ||
|
||
b.Property<int>("Number"); | ||
|
||
b.Property<string>("ParentId"); | ||
|
||
b.Property<string>("SecondRelationModelId"); | ||
|
||
b.Property<decimal>("Sum"); | ||
|
||
b.HasKey("Id"); | ||
}); | ||
|
||
modelBuilder.Entity("NonFactors.Mvc.Lookup.Tests.Objects.TestRelationModel", b => | ||
{ | ||
b.Property<string>("Id"); | ||
|
||
b.Property<string>("NoValue"); | ||
|
||
b.Property<string>("Value"); | ||
|
||
b.HasKey("Id"); | ||
}); | ||
|
||
modelBuilder.Entity("NonFactors.Mvc.Lookup.Tests.Objects.TestModel", b => | ||
{ | ||
b.HasOne("NonFactors.Mvc.Lookup.Tests.Objects.TestRelationModel") | ||
.WithMany() | ||
.HasForeignKey("FirstRelationModelId"); | ||
|
||
b.HasOne("NonFactors.Mvc.Lookup.Tests.Objects.TestRelationModel") | ||
.WithMany() | ||
.HasForeignKey("SecondRelationModelId"); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class EnumModel | ||
{ | ||
[LookupColumn] | ||
public IdEnum Id { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public enum IdEnum | ||
{ | ||
Id, | ||
Null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class NoIdModel | ||
{ | ||
[LookupColumn] | ||
public String Title { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class NoRelationModel | ||
{ | ||
[LookupColumn(Relation = "None")] | ||
public String NoRelation { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class NonNumericIdModel | ||
{ | ||
[LookupColumn] | ||
public Guid Id { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class NumericIdModel | ||
{ | ||
[LookupColumn] | ||
public Decimal Id { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace NonFactors.Mvc.Lookup.Tests.Objects | ||
{ | ||
public class TestModel | ||
{ | ||
[LookupColumn(0)] | ||
public String Id { get; set; } | ||
|
||
[LookupColumn] | ||
[Display(Name = "TestDisplay")] | ||
public Int32 Number { get; set; } | ||
|
||
[Lookup(typeof(TestLookupProxy))] | ||
public String ParentId { get; set; } | ||
|
||
[LookupColumn(-5, Format = "{0:d}")] | ||
public DateTime CreationDate { get; set; } | ||
|
||
public Decimal Sum { get; set; } | ||
public String NullableString { get; set; } | ||
|
||
public String FirstRelationModelId { get; set; } | ||
public String SecondRelationModelId { get; set; } | ||
|
||
[LookupColumn(1, Relation = "Value")] | ||
public virtual TestRelationModel FirstRelationModel { get; set; } | ||
|
||
[LookupColumn(1, Relation = "NoValue")] | ||
public virtual TestRelationModel SecondRelationModel { get; set; } | ||
} | ||
} |
Oops, something went wrong.