-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #351 from dansiegel/dev/ds/required-platforms
Add support for Platform Filtering on Property and Classes
- Loading branch information
Showing
31 changed files
with
671 additions
and
198 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,95 @@ | ||
using System; | ||
using E2E.Tests.Helpers; | ||
using Xunit; | ||
|
||
namespace E2E.Tests.Fixtures | ||
{ | ||
public class AppSettingsFixture | ||
{ | ||
[Fact] | ||
public void AStringIsOfTypeString() | ||
{ | ||
Assert.IsType<string>(AppSettings.AString); | ||
Assert.Equal("Hello World!", AppSettings.AString); | ||
} | ||
|
||
[Fact] | ||
public void AnIntIsOfTypeInt() | ||
{ | ||
Assert.IsType<int>(AppSettings.AnInt); | ||
Assert.Equal(5, AppSettings.AnInt); | ||
} | ||
|
||
[Fact] | ||
public void ADoubleIsOfTypeDouble() | ||
{ | ||
Assert.IsType<double>(AppSettings.ADouble); | ||
Assert.Equal(3.14, AppSettings.ADouble); | ||
} | ||
|
||
[Fact] | ||
public void ABoolIsOfTypeBool() | ||
{ | ||
Assert.IsType<bool>(AppSettings.ABool); | ||
Assert.False(AppSettings.ABool); | ||
} | ||
|
||
[Fact] | ||
public void AFloatIsOfTypeFloat() | ||
{ | ||
Assert.IsType<float>(AppSettings.AFloat); | ||
Assert.Equal(4.2F, AppSettings.AFloat); | ||
} | ||
|
||
[Fact] | ||
public void ADateIsOfTypeDateTime() | ||
{ | ||
Assert.IsType<DateTime>(AppSettings.ADate); | ||
Assert.Equal(DateTime.Parse("January 1, 2020"), AppSettings.ADate); | ||
} | ||
|
||
[Fact] | ||
public void AUriIsOfTypeUri() | ||
{ | ||
Assert.IsType<Uri>(AppSettings.AUri); | ||
Assert.Equal(new Uri("https://mobilebuildtools.com"), AppSettings.AUri); | ||
} | ||
|
||
[Fact] | ||
public void AStringArrayHas3Elements() | ||
{ | ||
Assert.Equal(3, AppSettings.AStringArray.Length); | ||
Assert.Contains("Foo", AppSettings.AStringArray); | ||
Assert.Contains("Bar", AppSettings.AStringArray); | ||
Assert.Contains("Baz", AppSettings.AStringArray); | ||
} | ||
|
||
[Fact] | ||
public void AStringArrayIsOfTypeStringArray() | ||
{ | ||
Assert.IsType<string[]>(AppSettings.AStringArray); | ||
Assert.Equal(3, AppSettings.AStringArray.Length); | ||
} | ||
|
||
[Fact] | ||
public void AppCenterSecretIsNull() | ||
{ | ||
Assert.Null(AppSettings.AppCenterSecret); | ||
} | ||
|
||
[Fact] | ||
public void SomeDefaultBoolIsFalse() | ||
{ | ||
Assert.IsType<bool>(AppSettings.SomeDefaultBool); | ||
Assert.False(AppSettings.SomeDefaultBool); | ||
} | ||
|
||
[Fact] | ||
public void DoesNotGeneratePlatformSpecificProperty() | ||
{ | ||
var type = typeof(AppSettings); | ||
var property = type.GetProperty("APlatformProperty"); | ||
Assert.Null(property); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,51 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
using E2E.Core; | ||
using Xunit; | ||
// using System; | ||
// using System.Collections.Generic; | ||
// using System.IO; | ||
// using System.Linq; | ||
// using System.Reflection; | ||
// using E2E.Core; | ||
// using Xunit; | ||
|
||
namespace E2E.Tests.Fixtures | ||
{ | ||
public class SCSSToCSSFixture | ||
{ | ||
public const string ExpectedCSSResourceId = "E2E.Core.theme.style.css"; | ||
public const string SecondaryExpectedCSSResourceId = "E2E.Core.theme.anotherStyle.css"; | ||
public const string ExpectedCSS = @".primaryButton{background-color:#006}^button{background-color:transparent}"; | ||
// namespace E2E.Tests.Fixtures | ||
// { | ||
// public class SCSSToCSSFixture | ||
// { | ||
// public const string ExpectedCSSResourceId = "E2E.Core.theme.style.css"; | ||
// public const string SecondaryExpectedCSSResourceId = "E2E.Core.theme.anotherStyle.css"; | ||
// public const string ExpectedCSS = @".primaryButton{background-color:#006}^button{background-color:transparent}"; | ||
|
||
[Fact] | ||
public void CssIsEmbedded() | ||
{ | ||
Assert.NotEmpty(CommonLib.GetManifestResourceNames()); | ||
Assert.Contains(ExpectedCSSResourceId, CommonLib.GetManifestResourceNames()); | ||
} | ||
// [Fact] | ||
// public void CssIsEmbedded() | ||
// { | ||
// Assert.NotEmpty(CommonLib.GetManifestResourceNames()); | ||
// Assert.Contains(ExpectedCSSResourceId, CommonLib.GetManifestResourceNames()); | ||
// } | ||
|
||
[Fact] | ||
public void SecondaryCssIsEmbedded() | ||
{ | ||
Assert.Contains(SecondaryExpectedCSSResourceId, CommonLib.GetManifestResourceNames()); | ||
} | ||
// [Fact] | ||
// public void SecondaryCssIsEmbedded() | ||
// { | ||
// Assert.Contains(SecondaryExpectedCSSResourceId, CommonLib.GetManifestResourceNames()); | ||
// } | ||
|
||
[Fact] | ||
public void CssWasProperlyFormatted() | ||
{ | ||
using (var stream = typeof(CommonLib).Assembly.GetManifestResourceStream(ExpectedCSSResourceId)) | ||
using (var reader = new StreamReader(stream)) | ||
{ | ||
Assert.NotNull(stream); | ||
var css = reader.ReadLine(); | ||
Assert.Equal(ExpectedCSS, css); | ||
} | ||
} | ||
// [Fact] | ||
// public void CssWasProperlyFormatted() | ||
// { | ||
// using (var stream = typeof(CommonLib).Assembly.GetManifestResourceStream(ExpectedCSSResourceId)) | ||
// using (var reader = new StreamReader(stream)) | ||
// { | ||
// Assert.NotNull(stream); | ||
// var css = reader.ReadLine(); | ||
// Assert.Equal(ExpectedCSS, css); | ||
// } | ||
// } | ||
|
||
[Fact] | ||
public void SCSSIsNotEmbedded() | ||
{ | ||
Assert.Empty(EmbeddedResources().Where(r => r.EndsWith(".scss", StringComparison.InvariantCultureIgnoreCase))); | ||
} | ||
// [Fact] | ||
// public void SCSSIsNotEmbedded() | ||
// { | ||
// Assert.Empty(EmbeddedResources().Where(r => r.EndsWith(".scss", StringComparison.InvariantCultureIgnoreCase))); | ||
// } | ||
|
||
private IEnumerable<string> EmbeddedResources() => | ||
GetType().Assembly.GetManifestResourceNames(); | ||
} | ||
} | ||
// private IEnumerable<string> EmbeddedResources() => | ||
// GetType().Assembly.GetManifestResourceNames(); | ||
// } | ||
// } |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.