public void ValidateMethodHappyPath() { var cloudEvent = new PartitionedEvent { Type = "MyType", Source = "/MySource", PartitionKey = "123" }; cloudEvent.Invoking(ce => ce.Validate()) .Should().NotThrow(); }
public void ValidateMethodSadPath(string partitionKey) { var cloudEvent = new PartitionedEvent { Type = "MyType", Source = "/MySource", PartitionKey = partitionKey }; cloudEvent.Invoking(ce => ce.Validate()) .Should().ThrowExactly <CloudEventValidationException>() .WithMessage("PartitionKey cannot be null or empty."); }