public void ShouldThrowExceptionWhenActionsIsNull() { ITemplate template = new ButtonsTemplate() { ThumbnailUrl = new Uri("https://foo.bar"), Title = "ButtonsTitle", Text = "ButtonsText" }; ExceptionAssert.Throws <InvalidOperationException>("The actions cannot be null.", () => { template.Validate(); }); }
public void ShouldThrowExceptionWhenTextIsNull() { ITemplate template = new ButtonsTemplate() { ThumbnailUrl = new Uri("https://foo.bar"), Title = "ButtonsTitle", Actions = new[] { new PostbackAction() } }; ExceptionAssert.Throws <InvalidOperationException>("The text cannot be null.", () => { template.Validate(); }); }
public void ShouldNotThrowExceptionWhenValid() { ITemplate template = new ButtonsTemplate() { ThumbnailUrl = new Uri("https://foo.bar"), Title = "ButtonsTitle", Text = "ButtonsText", Actions = new[] { new PostbackAction() { Data = "Foo", Label = "Bar" } } }; template.Validate(); }