mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
#694 ✨ Exception信息 国际化 多语言
This commit is contained in:
657
FreeSql.Tests/FreeSql.Tests/Properties/CoreStringsTests.cs
Normal file
657
FreeSql.Tests/FreeSql.Tests/Properties/CoreStringsTests.cs
Normal file
@ -0,0 +1,657 @@
|
||||
using System.Threading;
|
||||
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace FreeSql.Tests.Properties
|
||||
{
|
||||
public class CoreStringsTests
|
||||
{
|
||||
private readonly ITestOutputHelper output;
|
||||
public CoreStringsTests(ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
|
||||
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
|
||||
}
|
||||
[Fact]
|
||||
public void AsTable_PropertyName_NotDateTimeTest()
|
||||
{
|
||||
string text = CoreStrings.AsTable_PropertyName_NotDateTime("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AsTable_PropertyName_FormatErrorTest()
|
||||
{
|
||||
string text = CoreStrings.AsTable_PropertyName_FormatError("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void Available_Failed_Get_ResourceTest()
|
||||
{
|
||||
string text = CoreStrings.Available_Failed_Get_Resource("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Available_Thrown_ExceptionTest()
|
||||
{
|
||||
string text = CoreStrings.Available_Thrown_Exception("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Bad_Expression_FormatTest()
|
||||
{
|
||||
string text = CoreStrings.Bad_Expression_Format("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cannot_Be_NULL_NameTest()
|
||||
{
|
||||
string text = CoreStrings.Cannot_Be_NULL_Name("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cannot_Match_PropertyTest()
|
||||
{
|
||||
string text = CoreStrings.Cannot_Match_Property("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cannot_Resolve_ExpressionTreeTest()
|
||||
{
|
||||
string text = CoreStrings.Cannot_Resolve_ExpressionTree("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Custom_Expression_ParsingErrorTest()
|
||||
{
|
||||
string text = CoreStrings.Custom_Expression_ParsingError("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Custom_StaticMethodName_NotSet_DynamicFilterCustomTest()
|
||||
{
|
||||
string text = CoreStrings.Custom_StaticMethodName_NotSet_DynamicFilterCustom("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DataType_AsType_InconsistentTest()
|
||||
{
|
||||
string text = CoreStrings.DataType_AsType_Inconsistent("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DbUpdateVersionException_RowLevelOptimisticLockTest()
|
||||
{
|
||||
string text = CoreStrings.DbUpdateVersionException_RowLevelOptimisticLock("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Duplicate_ColumnAttributeTest()
|
||||
{
|
||||
string text = CoreStrings.Duplicate_ColumnAttribute("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Duplicate_PropertyNameTest()
|
||||
{
|
||||
string text = CoreStrings.Duplicate_PropertyName("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Entity_Must_Primary_KeyTest()
|
||||
{
|
||||
string text = CoreStrings.Entity_Must_Primary_Key("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeysTest()
|
||||
{
|
||||
string text = CoreStrings.Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeys("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Entity_NotParentChild_RelationshipTest()
|
||||
{
|
||||
string text = CoreStrings.Entity_NotParentChild_Relationship("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Expression_Error_Use_ParameterExpressionTest()
|
||||
{
|
||||
string text = CoreStrings.Expression_Error_Use_ParameterExpression("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Expression_Error_Use_Successive_MemberAccess_TypeTest()
|
||||
{
|
||||
string text = CoreStrings.Expression_Error_Use_Successive_MemberAccess_Type("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExpressionTree_Convert_Type_ErrorTest()
|
||||
{
|
||||
string text = CoreStrings.ExpressionTree_Convert_Type_Error("1", "2", "3", "4 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Failed_SubTable_FieldValueTest()
|
||||
{
|
||||
string text = CoreStrings.Failed_SubTable_FieldValue("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Functions_AsTable_NotImplementedTest()
|
||||
{
|
||||
string text = CoreStrings.Functions_AsTable_NotImplemented("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Generated_Same_SubTableTest()
|
||||
{
|
||||
string text = CoreStrings.Generated_Same_SubTable("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPrimarys_ParameterError_IsNotDictKeyTest()
|
||||
{
|
||||
string text = CoreStrings.GetPrimarys_ParameterError_IsNotDictKey("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Has_Specified_Cannot_Specified_SecondTest()
|
||||
{
|
||||
string text = CoreStrings.Has_Specified_Cannot_Specified_Second("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ignored_Check_Confirm_PublicGetSetTest()
|
||||
{
|
||||
string text = CoreStrings.Ignored_Check_Confirm_PublicGetSet("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IncludeMany_NotValid_NavigationTest()
|
||||
{
|
||||
string text = CoreStrings.IncludeMany_NotValid_Navigation("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IncludeMany_ParameterError_OnlyUseOneParameterTest()
|
||||
{
|
||||
string text = CoreStrings.IncludeMany_ParameterError_OnlyUseOneParameter("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IncludeMany_ParameterError_Select_ReturnConsistentTypeTest()
|
||||
{
|
||||
string text = CoreStrings.IncludeMany_ParameterError_Select_ReturnConsistentType("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IncludeMany_ParameterTypeErrorTest()
|
||||
{
|
||||
string text = CoreStrings.IncludeMany_ParameterTypeError("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertInto_No_Property_SelectedTest()
|
||||
{
|
||||
string text = CoreStrings.InsertInto_No_Property_Selected("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertInto_TypeErrorTest()
|
||||
{
|
||||
string text = CoreStrings.InsertInto_TypeError("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertOrUpdate_Must_Primary_KeyTest()
|
||||
{
|
||||
string text = CoreStrings.InsertOrUpdate_Must_Primary_Key("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertOrUpdate_NotSuport_Generic_UseEntityTest()
|
||||
{
|
||||
string text = CoreStrings.InsertOrUpdate_NotSuport_Generic_UseEntity("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LazyLoading_CompilationErrorTest()
|
||||
{
|
||||
string text = CoreStrings.LazyLoading_CompilationError("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LazyLoading_EntityMustDeclarePublicTest()
|
||||
{
|
||||
string text = CoreStrings.LazyLoading_EntityMustDeclarePublic("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_NotFound_CorrespondingFieldTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_NotFound_CorrespondingField("1", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_ParsingError_EntityMissing_PrimaryKeyTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_ParsingError_EntityMissing_PrimaryKey("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_ParsingError_EntityMustHas_NavigateCollectionTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_ParsingError_EntityMustHas_NavigateCollection("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_ParsingError_InconsistentTypeTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_ParsingError_InconsistentType("1", "2", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_ParsingError_IntermediateClass_ErrorMessageTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage("1", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOneTest()
|
||||
{
|
||||
string text = CoreStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne("1", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Mapping_Exception_HasNo_SamePropertyNameTest()
|
||||
{
|
||||
string text = CoreStrings.Mapping_Exception_HasNo_SamePropertyName("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Missing_FreeSqlProvider_PackageTest()
|
||||
{
|
||||
string text = CoreStrings.Missing_FreeSqlProvider_Package("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Missing_FreeSqlProvider_Package_ReasonTest()
|
||||
{
|
||||
string text = CoreStrings.Missing_FreeSqlProvider_Package_Reason("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_Bind_Number_DifferentTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_Bind_Number_Different("1", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_Missing_AsSelectTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_Missing_AsSelect("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_Missing_SetPropertyTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_Missing_SetProperty("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_NotFound_CorrespondingFieldTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_NotFound_CorrespondingField("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_ParsingError_EntityMissingPrimaryKeyTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_ParsingError_EntityMissingPrimaryKey("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_ParsingError_InconsistentTypeTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_ParsingError_InconsistentType("1", "2", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Navigation_ParsingError_NotFound_PropertyTest()
|
||||
{
|
||||
string text = CoreStrings.Navigation_ParsingError_NotFound_Property("1", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NoPrimaryKey_UseSetDtoTest()
|
||||
{
|
||||
string text = CoreStrings.NoPrimaryKey_UseSetDto("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Implemented_ExpressionTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Implemented_Expression("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Implemented_Expression_ParameterUseConstantTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Implemented_Expression_ParameterUseConstant("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Implemented_Expression_UseAsSelectTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Implemented_Expression_UseAsSelect("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Implemented_NameTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Implemented_Name("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Support_OrderByRandomTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Support_OrderByRandom("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Not_Valid_Navigation_PropertyTest()
|
||||
{
|
||||
string text = CoreStrings.Not_Valid_Navigation_Property("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_ColumnTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Column("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_CsName_ColumnTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Column("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_PropertyTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Property("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_PropertyNameTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_PropertyName("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_ReflectionTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Reflection("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_Static_MethodNameTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Static_MethodName("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_Table_Property_AsTableTest()
|
||||
{
|
||||
string text = CoreStrings.NotFound_Table_Property_AsTable("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ObjectPool_Get_TimeoutTest()
|
||||
{
|
||||
string text = CoreStrings.ObjectPool_Get_Timeout("1", "2", "3");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ObjectPool_GetAsync_Queue_LongTest()
|
||||
{
|
||||
string text = CoreStrings.ObjectPool_GetAsync_Queue_Long("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OneToMany_NotFound_CorrespondingFieldTest()
|
||||
{
|
||||
string text = CoreStrings.OneToMany_NotFound_CorrespondingField("1", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OneToMany_ParsingError_InconsistentTypeTest()
|
||||
{
|
||||
string text = CoreStrings.OneToMany_ParsingError_InconsistentType("1", "2", "2", "2", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OneToMany_UseNavigateTest()
|
||||
{
|
||||
string text = CoreStrings.OneToMany_UseNavigate("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotValid_CollectionTest()
|
||||
{
|
||||
string text = CoreStrings.ParameterError_NotValid_Collection("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotValid_NavigationTest()
|
||||
{
|
||||
string text = CoreStrings.ParameterError_NotValid_Navigation("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotValid_PropertyNameTest()
|
||||
{
|
||||
string text = CoreStrings.ParameterError_NotValid_PropertyName("1", "2", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotValid_UseCommasTest()
|
||||
{
|
||||
string text = CoreStrings.ParameterError_NotValid_UseCommas("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Parsing_FailedTest()
|
||||
{
|
||||
string text = CoreStrings.Parsing_Failed("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Policy_ObjectPool_DisposeTest()
|
||||
{
|
||||
string text = CoreStrings.Policy_ObjectPool_Dispose("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Policy_Status_NotAvailableTest()
|
||||
{
|
||||
string text = CoreStrings.Policy_Status_NotAvailable("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Properties_AsRowLock_Must_Numeric_ByteTest()
|
||||
{
|
||||
string text = CoreStrings.Properties_AsRowLock_Must_Numeric_Byte("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Property_Cannot_FindTest()
|
||||
{
|
||||
string text = CoreStrings.Property_Cannot_Find("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Set_Column_IsNullable_FalseTest()
|
||||
{
|
||||
string text = CoreStrings.Set_Column_IsNullable_False("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SubTableFieldValue_CannotLessThenTest()
|
||||
{
|
||||
string text = CoreStrings.SubTableFieldValue_CannotLessThen("1", "2 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SubTableFieldValue_NotConvertDateTimeTest()
|
||||
{
|
||||
string text = CoreStrings.SubTableFieldValue_NotConvertDateTime("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SubTableFieldValue_NotMatchTableTest()
|
||||
{
|
||||
string text = CoreStrings.SubTableFieldValue_NotConvertDateTime("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void Type_AsType_Parameter_ErrorTest()
|
||||
{
|
||||
string text = CoreStrings.Type_AsType_Parameter_Error("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Type_Cannot_Access_ConstructorTest()
|
||||
{
|
||||
string text = CoreStrings.Type_Cannot_Access_Constructor("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Type_Error_NameTest()
|
||||
{
|
||||
string text = CoreStrings.Type_Error_Name("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TypeAsType_NotSupport_ObjectTest()
|
||||
{
|
||||
string text = CoreStrings.TypeAsType_NotSupport_Object("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TypeError_CannotUse_IncludeManyTest()
|
||||
{
|
||||
string text = CoreStrings.TypeError_CannotUse_IncludeMany("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Unable_Parse_ExpressionTest()
|
||||
{
|
||||
string text = CoreStrings.Unable_Parse_Expression("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Unable_Parse_ExpressionMethodTest()
|
||||
{
|
||||
string text = CoreStrings.Unable_Parse_ExpressionMethod("1 ");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
260
FreeSql.Tests/FreeSql.Tests/Properties/DbContextStringsTests.cs
Normal file
260
FreeSql.Tests/FreeSql.Tests/Properties/DbContextStringsTests.cs
Normal file
@ -0,0 +1,260 @@
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace FreeSql.Tests.Properties
|
||||
{
|
||||
public class DbContextStringsTests
|
||||
{
|
||||
private readonly ITestOutputHelper output;
|
||||
public DbContextStringsTests(ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
|
||||
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddFreeDbContextError_CheckConstructionTest()
|
||||
{
|
||||
string text = DbContextStrings.AddFreeDbContextError_CheckConstruction("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAdd_AlreadyExistsInStateManagementTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAdd_AlreadyExistsInStateManagement("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAdd_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAdd_PrimaryKey_NotSetTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAdd_PrimaryKey_NotSet("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAdd_SelfIncreasingHasValueTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAdd_SelfIncreasingHasValue("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAttach_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAttach_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotAttach_PrimaryKey_NotSetTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotAttach_PrimaryKey_NotSet("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotDelete_DataNotTracked_ShouldQueryTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotDelete_DataNotTracked_ShouldQuery("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotDelete_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotDelete_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotDelete_PrimaryKey_NotSetTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotDelete_PrimaryKey_NotSet("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotEdit_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotEdit_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotUpdate_DataShouldQueryOrAttachTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotUpdate_DataShouldQueryOrAttach("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotUpdate_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotUpdate_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotUpdate_PrimaryKey_NotSetTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotUpdate_PrimaryKey_NotSet("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CannotUpdate_RecordDoesNotExistTest()
|
||||
{
|
||||
string text = DbContextStrings.CannotUpdate_RecordDoesNotExist("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EntityType_CannotConvertTest()
|
||||
{
|
||||
string text = DbContextStrings.EntityType_CannotConvert("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EntityType_PrimaryKeyErrorTest()
|
||||
{
|
||||
string text = DbContextStrings.EntityType_PrimaryKeyError("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EntityType_PrimaryKeyIsNotOneTest()
|
||||
{
|
||||
string text = DbContextStrings.EntityType_PrimaryKeyIsNotOne("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Incomparable_EntityHasNo_PrimaryKeyTest()
|
||||
{
|
||||
string text = DbContextStrings.Incomparable_EntityHasNo_PrimaryKey("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Incomparable_PrimaryKey_NotSetTest()
|
||||
{
|
||||
string text = DbContextStrings.Incomparable_PrimaryKey_NotSet("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertError_FilterTest()
|
||||
{
|
||||
string text = DbContextStrings.InsertError_Filter("1", "2", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotFound_PropertyTest()
|
||||
{
|
||||
string text = DbContextStrings.NotFound_Property("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterDataTypeErrorTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterDataTypeError("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterErrorTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterError("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_CannotBeNullTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterError_CannotBeNull("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_IsNot_CollectionPropertiesTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterError_IsNot_CollectionProperties("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotFound_CollectionPropertiesTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterError_NotFound_CollectionProperties("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParameterError_NotFound_PropertyTest()
|
||||
{
|
||||
string text = DbContextStrings.ParameterError_NotFound_Property("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PropertyOfType_IsNot_OneToManyOrManyToManyTest()
|
||||
{
|
||||
string text = DbContextStrings.PropertyOfType_IsNot_OneToManyOrManyToMany("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpecialError_BatchAdditionFailedTest()
|
||||
{
|
||||
string text = DbContextStrings.SpecialError_BatchAdditionFailed("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpecialError_UpdateFailedDataNotTrackedTest()
|
||||
{
|
||||
string text = DbContextStrings.SpecialError_UpdateFailedDataNotTracked("1");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TypeHasSetProperty_IgnoreAttributeTest()
|
||||
{
|
||||
string text = DbContextStrings.TypeHasSetProperty_IgnoreAttribute("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnitOfWorkManager_Construction_CannotBeNullTest()
|
||||
{
|
||||
string text = DbContextStrings.UnitOfWorkManager_Construction_CannotBeNull("1", "2");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UpdateError_FilterTest()
|
||||
{
|
||||
string text = DbContextStrings.UpdateError_Filter("1", "2", "3");
|
||||
output.WriteLine(text);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,6 +16,11 @@ namespace FreeSql.Tests
|
||||
{
|
||||
public class UnitTest5
|
||||
{
|
||||
[Fact]
|
||||
public void AsTable_PropertyName_FormatErrorTest1()
|
||||
{
|
||||
CoreStrings.AsTable_PropertyName_FormatError("astable");
|
||||
}
|
||||
// DTO
|
||||
public class TestDto
|
||||
{
|
||||
|
Reference in New Issue
Block a user