36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using AwesomeAssertions;
|
|
using GerstITS.Examples.Logic.Customers;
|
|
using GerstITS.Examples.Logic.Customers.Customizations;
|
|
using GerstITS.System.Customizations;
|
|
using GerstITS.TestFramework;
|
|
using Xunit;
|
|
|
|
namespace GerstITS.Examples.Tests.Customers.Customizations;
|
|
|
|
[TestCategory(TestCategories.Unit)]
|
|
public sealed class CustomerDisplayNameCustomizationTest
|
|
{
|
|
#region Tests
|
|
|
|
[Fact]
|
|
public void If_a_customer_is_customized___The_display_name_is_composed()
|
|
{
|
|
ICustomization customization = new CustomerDisplayNameCustomization();
|
|
var customer = new Customer { FirstName = "Erika", LastName = "Mustermann" };
|
|
|
|
var customized = customization.Customize(customer, null);
|
|
|
|
customized.DisplayName.Should().Be("Mustermann, Erika");
|
|
}
|
|
|
|
[Fact]
|
|
public void If_the_customer_is_null___It_cannot_be_customized()
|
|
{
|
|
ICustomization customization = new CustomerDisplayNameCustomization();
|
|
|
|
customization.CanCustomize<Customer>(null, null).Should().BeFalse();
|
|
}
|
|
|
|
#endregion
|
|
}
|