public void GetMessageFail() { var repo = new HelloWorldRepo(); var options = new ConfigOptions() { FetchFromDb = true }; var logic = new HelloWorldLogic(repo, options); var result = logic.GetMessage(); Assert.False(result.Success); Assert.Equal("Not implemented yet.", result.ErrorMessage); }
public string Get() { HelloWorldLogic helloWorldLogic; if (settings?.Value?.ConnectionString == null) { helloWorldLogic = new HelloWorldLogic(); } else { helloWorldLogic = new HelloWorldLogic(settings.Value.ConnectionString); } return(helloWorldLogic.GetGreeting()); }
public void GetMessageSuccess() { string message = "Hello World!!!"; var repo = new HelloWorldRepo(); var options = new ConfigOptions() { DefaultMessage = message, FetchFromDb = false }; var logic = new HelloWorldLogic(repo, options); var result = logic.GetMessage(); Assert.True(result.Success); Assert.Equal("Hello World!!!", result.Dto); }