Пример #1
0
        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);
        }
Пример #2
0
        public string Get()
        {
            HelloWorldLogic helloWorldLogic;

            if (settings?.Value?.ConnectionString == null)
            {
                helloWorldLogic = new HelloWorldLogic();
            }
            else
            {
                helloWorldLogic = new HelloWorldLogic(settings.Value.ConnectionString);
            }

            return(helloWorldLogic.GetGreeting());
        }
Пример #3
0
        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);
        }