Skip to content

Commit

Permalink
Minor format adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Turnerj committed Jan 26, 2018
1 parent 95d1363 commit 0e1d8cf
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 28 deletions.
6 changes: 2 additions & 4 deletions MongoFramework.Tests/AssertExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public class AssertExtensions
/// <typeparam name="T"></typeparam>
/// <param name="expressionUnderTest"></param>
/// <param name="exceptionMessage"></param>
public static void DoesNotThrow<T>(Action expressionUnderTest,
string exceptionMessage = "Expected exception was thrown by target of invocation.") where T : Exception
public static void DoesNotThrow<T>(Action expressionUnderTest, string exceptionMessage = "Expected exception was thrown by target of invocation.") where T : Exception
{
try
{
Expand All @@ -39,8 +38,7 @@ public static void DoesNotThrow<T>(Action expressionUnderTest,
/// <typeparam name="T"></typeparam>
/// <param name="expressionUnderTest"></param>
/// <param name="exceptionMessage"></param>
public static async Task DoesNotThrowAsync<T>(Func<Task> expressionUnderTest,
string exceptionMessage = "Expected exception was thrown by target of invocation.") where T : Exception
public static async Task DoesNotThrowAsync<T>(Func<Task> expressionUnderTest, string exceptionMessage = "Expected exception was thrown by target of invocation.") where T : Exception
{
try
{
Expand Down
4 changes: 2 additions & 2 deletions MongoFramework.Tests/Indexing/EntityIndexWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class EntityIndexWriterTests
public class IndexModel
{
public string Id { get; set; }
[Index(IndexSortOrder.Ascending)] public string IndexedPropertyOne { get; set; }

[Index(IndexSortOrder.Ascending)]
public string IndexedPropertyOne { get; set; }
[Index("MyIndexedProperty", IndexSortOrder.Descending)]
public string IndexedPropertyTwo { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ namespace MongoFramework.Tests.Indexing.Processors.BasicIndex
{
public class IndexNamingModel
{
[Index(IndexSortOrder.Ascending)] public string NoNameIndex { get; set; }

[Index(IndexSortOrder.Ascending)]
public string NoNameIndex { get; set; }
[Index("MyCustomIndexName", IndexSortOrder.Ascending)]
public string NamedIndex { get; set; }
}

public class IndexSortOrderModel
{
[Index(IndexSortOrder.Ascending)] public string AscendingIndex { get; set; }
[Index(IndexSortOrder.Descending)] public string DescendingIndex { get; set; }
[Index(IndexSortOrder.Ascending)]
public string AscendingIndex { get; set; }
[Index(IndexSortOrder.Descending)]
public string DescendingIndex { get; set; }
}

public class UniqueConstraintModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ namespace MongoFramework.Tests.Mapping.Processors.EntityId
{
public class IdByAttributeTestModel
{
[Key] public string MyCustomId { get; set; }
[Key]
public string MyCustomId { get; set; }
}

public class StringIdGeneratorTestModel
{
[Key] public string MyCustomId { get; set; }
[Key]
public string MyCustomId { get; set; }
}

public class GuidIdGeneratorTestModel
{
[Key] public Guid MyCustomId { get; set; }
[Key]
public Guid MyCustomId { get; set; }
}

public class ObjectIdGeneratorTestModel
{
[Key] public ObjectId MyCustomId { get; set; }
[Key]
public ObjectId MyCustomId { get; set; }
}

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ namespace MongoFramework.Tests.Mapping.Processors.MappedProperties
public class NotMappedPropertiesModel
{
public string Id { get; set; }
[NotMapped] public string NotMapped { get; set; }
[NotMapped]
public string NotMapped { get; set; }
}

public class ColumnAttributePropertyModel
{
public string Id { get; set; }
[Column("CustomPropertyName")] public string MyProperty { get; set; }
[Column("CustomPropertyName")]
public string MyProperty { get; set; }
}

[TestClass]
Expand Down
4 changes: 1 addition & 3 deletions MongoFramework.Tests/MongoDbContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ namespace MongoFramework.Tests
{
public class MongoDbContextTestContext : MongoDbContext
{
public MongoDbContextTestContext(string connectionString, string databaseName) : base(connectionString, databaseName)
{
}
public MongoDbContextTestContext(string connectionString, string databaseName) : base(connectionString, databaseName) { }

public MongoDbSet<MongoDbContextModel> ContextDbSet { get; set; }
}
Expand Down
3 changes: 2 additions & 1 deletion MongoFramework.Tests/MongoDbSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class MongoDbSetValidationModel
{
public string Id { get; set; }

[Required] public string RequiredField { get; set; }
[Required]
public string RequiredField { get; set; }
}

[TestClass]
Expand Down
2 changes: 1 addition & 1 deletion MongoFramework.Tests/MongoFramework.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets'))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public class ValidAttributeUseModel
{
public string Id { get; set; }

[CreatedDate] public DateTime CreatedDate { get; set; }
[CreatedDate]
public DateTime CreatedDate { get; set; }
}

public class InvalidAttributeUseModel
{
public string Id { get; set; }

[CreatedDate] public string CreatedDate { get; set; }
[CreatedDate]
public string CreatedDate { get; set; }
}

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ namespace MongoFramework.Tests.Mutation.Mutators.IncrementNumber
{
public class IncrementalEntity
{
[IncrementNumber] public int ByDefault { get; set; }
[IncrementNumber(true)] public int ByUpdateOnly { get; set; }
[IncrementNumber(10)] public int ByTen { get; set; }
[IncrementNumber]
public int ByDefault { get; set; }
[IncrementNumber(true)]
public int ByUpdateOnly { get; set; }
[IncrementNumber(10)]
public int ByTen { get; set; }
}

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public class ValidAttributeUseModel
{
public string Id { get; set; }

[UpdatedDate] public DateTime UpdatedDate { get; set; }
[UpdatedDate]
public DateTime UpdatedDate { get; set; }
}

public class InvalidAttributeUseModel
{
public string Id { get; set; }

[UpdatedDate] public string UpdatedDate { get; set; }
[UpdatedDate]
public string UpdatedDate { get; set; }
}

[TestClass]
Expand Down

0 comments on commit 0e1d8cf

Please sign in to comment.