public void GetChainFromExpression_should_return_a_chain() { // Arrange var builder = new ValidationBuilder<Order, string>(x => x.OrderDetails[0].ProductCode); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order.OrderDetails[0].ProductCode")); }
public void ChainName_should_return_container_name_if_cannot_resolve_value_from_expression() { // Arrange var builder = new ValidationBuilder<Order, string>(null); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order")); }
public void GetChainFromExpression_should_return_a_container_if_expression_type_is_not_member_access() { // Arrange var builder = new ValidationBuilder <Order, string>(x => "Not A Member Access Expression"); builder.UpdateContainerName("The.Order.OrderDetails[0].Id"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order.OrderDetails[0].Id")); }
public void GetChainFromExpression_should_return_a_chain() { // Arrange var builder = new ValidationBuilder <Order, string>(x => x.OrderDetails[0].ProductCode); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order.OrderDetails[0].ProductCode")); }
public void ChainName_should_return_container_name_if_cannot_resolve_value_from_expression() { // Arrange var builder = new ValidationBuilder <Order, string>(null); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order")); }
public void ContainerName_when_set_will_update_chain_name() { // Arrange var builder = new ValidationBuilder<Order, string>(null); builder.ChainName = "Chain.Name"; Assert.That(builder.ChainName, Is.EqualTo("Chain.Name")); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order")); }
public void ContainerName_when_set_will_update_chain_name() { // Arrange var builder = new ValidationBuilder <Order, string>(null); builder.ChainName = "Chain.Name"; Assert.That(builder.ChainName, Is.EqualTo("Chain.Name")); builder.UpdateContainerName("The.Order"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order")); }
public void GetChainFromExpression_should_return_a_container_if_expression_type_is_not_member_access() { // Arrange var builder = new ValidationBuilder<Order, string>(x => "Not A Member Access Expression"); builder.UpdateContainerName("The.Order.OrderDetails[0].Id"); // Action var name = builder.ChainName; // Assert Assert.That(name, Is.EqualTo("The.Order.OrderDetails[0].Id")); }