-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Major refactoring of the scanning process
* Fixed unit tests * Extracted specific target type scanners
- Loading branch information
valdisiljuconoks
authored and
valdisiljuconoks
committed
Nov 12, 2016
1 parent
f7199e9
commit 2928cfd
Showing
32 changed files
with
679 additions
and
334 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
Tests/DbLocalizationProvider.EPiServer.Sample/App_Data/EPiServerDB_3f986989.mdf
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Tests/DbLocalizationProvider.EPiServer.Sample/App_Data/EPiServerDB_3f986989_log.ldf
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Tests/DbLocalizationProvider.MvcSample/App_Data/DbLocalizationProvider.MvcSample.mdf
Binary file not shown.
Binary file modified
BIN
+272 KB
(150%)
Tests/DbLocalizationProvider.MvcSample/App_Data/DbLocalizationProvider.MvcSample_log.ldf
Binary file not shown.
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
7 changes: 7 additions & 0 deletions
7
Tests/DbLocalizationProvider.MvcSample/Views/Shared/EditorTemplates/Username.cshtml
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,7 @@ | ||
@model string | ||
|
||
@Html.LabelFor(m => m) | ||
@Html.TextBoxFor(m => m) | ||
@Html.ValidationMessageFor(m => m) | ||
|
||
[@ViewData.ModelMetadata.Description] |
12 changes: 12 additions & 0 deletions
12
Tests/DbLocalizationProvider.Tests/DataAnnotations/BaseViewModel.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,12 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace DbLocalizationProvider.Tests.DataAnnotations | ||
{ | ||
[LocalizedModel] | ||
public class BaseViewModel | ||
{ | ||
[Display(Name = "Base property", Description = "")] | ||
[Required] | ||
public string BaseProperty { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Tests/DbLocalizationProvider.Tests/DataAnnotations/SampleViewModelWithBase.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,13 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace DbLocalizationProvider.Tests.DataAnnotations | ||
{ | ||
[LocalizedModel(Inherited = false)] | ||
public class SampleViewModelWithBase : BaseViewModel | ||
{ | ||
[Display(Name = "Child property", Description = "")] | ||
[Required] | ||
[StringLength(100)] | ||
public string ChildProperty { get; set; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Tests/DbLocalizationProvider.Tests/DataAnnotations/ViewModelWithInheritanceTests.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,22 @@ | ||
using System.Linq; | ||
using DbLocalizationProvider.Sync; | ||
using Xunit; | ||
|
||
namespace DbLocalizationProvider.Tests.DataAnnotations | ||
{ | ||
public class ViewModelWithInheritanceTests | ||
{ | ||
[Fact] | ||
public void NotInheritedModel_ContainsOnlyDeclaredProperties() | ||
{ | ||
var sut = new TypeDiscoveryHelper(); | ||
var properties = sut.ScanResources(typeof(SampleViewModelWithBase)); | ||
var keys = properties.Select(p => p.Key).ToList(); | ||
|
||
Assert.Contains("DbLocalizationProvider.Tests.DataAnnotations.SampleViewModelWithBase.ChildProperty-Description", keys); | ||
Assert.DoesNotContain("DbLocalizationProvider.Tests.DataAnnotations.SampleViewModelWithBase.BaseProperty", keys); | ||
Assert.DoesNotContain("DbLocalizationProvider.Tests.DataAnnotations.SampleViewModelWithBase.BaseProperty-Required", keys); | ||
Assert.DoesNotContain("DbLocalizationProvider.Tests.DataAnnotations.SampleViewModelWithBase.ChildProperty-Description-Required", keys); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.