You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/test/Volo.Abp.Data.Tests/Volo/Abp/Data/ConnectionStringNameAttribu...

35 lines
868 B

using Shouldly;
using Xunit;
namespace Volo.Abp.Data
{
public class ConnectionStringNameAttribute_Tests
{
[Fact]
public void Should_Get_Class_FullName_If_Not_ConnStringNameAttribute_Specified()
{
ConnectionStringNameAttribute
.GetConnStringName<MyClassWithoutConnStringName>()
.ShouldBe(typeof(MyClassWithoutConnStringName).FullName);
}
[Fact]
public void Should_Get_ConnStringName_If_Not_Specified()
{
ConnectionStringNameAttribute
.GetConnStringName<MyClassWithConnStringName>()
.ShouldBe("MyDb");
}
private class MyClassWithoutConnStringName
{
}
[ConnectionStringName("MyDb")]
private class MyClassWithConnStringName
{
}
}
}