Permalink
Browse files

production deploy working

  • Loading branch information...
ehelin committed Jun 30, 2018
1 parent a6f4244 commit 390e78bfebacc648a077419cac91afd879286eb1
View
@@ -8,12 +8,21 @@
namespace API
{
// TODO - DI databases
public class TgimbaService : ITgimbaService
{
// TODO - DI logger
private static Enums.LogLevel level = Enums.LogLevel.Info;
private ILogger logger = new Logger(new BucketListData(Utilities.GetDbSetting()), level);
public string GetTestResult()
{
return "Test Service Response";
}
public void Log(string msg, Enums.LogLevel level)
{
this.logger.Log(msg, level);
}
public string LoginDemoUser()
{
string token = string.Empty;
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using Shared.misc;
namespace Shared.interfaces
{
public interface ILogger
{
void Log(string msg, Enums.LogLevel level);
}
}
@@ -1,4 +1,6 @@
namespace Shared.interfaces
using Shared.misc;
namespace Shared.interfaces
{
public interface ITgimbaService
{
@@ -12,5 +14,7 @@ public interface ITgimbaService
string[] DeleteBucketListItem(int bucketListDbId, string encodedUser, string encodedToken);
string[] GetDashboard();
string LoginDemoUser();
void Log(string msg, Enums.LogLevel level);
}
}
View
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.misc
{
public class Enums
{
public enum LogLevel { Error, Info, Verbose}
}
}
View
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using Shared.interfaces;
using Shared.misc;
namespace Shared.misc
{
public class Logger : ILogger
{
private IBucketListData db = null;
private Enums.LogLevel level;
public Logger(IBucketListData db, Enums.LogLevel level)
{
this.db = db;
this.level = level;
}
public void Log(string msg, Enums.LogLevel level)
{
if (level <= this.level)
{
db.LogMsg(msg);
}
}
}
}
View
@@ -0,0 +1,24 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shared.interfaces;
using Shared.misc;
//using Moq;
namespace TestShared
{
[TestClass]
public class LoggerTest
{
//Tests
//log error - log message
//log verbose - log message
//log verbose on error level - no log message
//no db - throw error
//no level - minimum level
[TestMethod]
public void TestLoggerMsg()
{
}
}
}
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
</ItemGroup>
</Project>
View
@@ -20,7 +20,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAPI", "TestAPI\TestAPI.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TgimbaNetCoreWeb", "TgimbaNetCoreWeb\TgimbaNetCoreWeb.csproj", "{CF678192-CA9C-4ACD-B859-828F35EA5F8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTgimbaNetCoreWeb", "TestTgimbaNetCoreWeb\TestTgimbaNetCoreWeb.csproj", "{BCE35BDF-40CC-4ACE-9E2C-BF8C412A0C8E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestsTgimbaNetCoreWeb", "TestTgimbaNetCoreWeb\TestsTgimbaNetCoreWeb.csproj", "{BCE35BDF-40CC-4ACE-9E2C-BF8C412A0C8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestsShared", "TestShared\TestsShared.csproj", "{1DDCF869-166F-46EA-ADAB-C3168E96B788}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -56,6 +58,10 @@ Global
{BCE35BDF-40CC-4ACE-9E2C-BF8C412A0C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BCE35BDF-40CC-4ACE-9E2C-BF8C412A0C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BCE35BDF-40CC-4ACE-9E2C-BF8C412A0C8E}.Release|Any CPU.Build.0 = Release|Any CPU
{1DDCF869-166F-46EA-ADAB-C3168E96B788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DDCF869-166F-46EA-ADAB-C3168E96B788}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DDCF869-166F-46EA-ADAB-C3168E96B788}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DDCF869-166F-46EA-ADAB-C3168E96B788}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -9,7 +9,6 @@ import { NavMenuComponent } from './components/navmenu/navmenu.component';
import { HomeComponent } from './components/home/home.component';
import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
import { CounterComponent } from './components/counter/counter.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { StaticDisplayComponent } from './components/staticdisplay/staticdisplay.component';
import { LoginComponent } from './components/login/login.component';
import { AddEditComponent } from './components/addedit/addedit.component';
@@ -29,7 +28,6 @@ import { RegistrationComponent } from './components/registration/registration.co
CounterComponent,
FetchDataComponent,
HomeComponent,
DashboardComponent,
StaticDisplayComponent,
LoginComponent,
AddEditComponent,
@@ -49,7 +47,6 @@ import { RegistrationComponent } from './components/registration/registration.co
RouterModule.forRoot([
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'staticdisplay', component: StaticDisplayComponent },
{ path: 'login', component: LoginComponent },
{ path: 'addedit', component: AddEditComponent },

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -2,9 +2,6 @@
<li [routerLinkActive]="['link-active']">
<a [routerLink]="['/addedit']">Add Edit</a>
</li>
<li [routerLinkActive]="['link-active']">
<a [routerLink]="['/dashboard']">Dashboard</a>
</li>
<li [routerLinkActive]="['link-active']">
<a [routerLink]="['/desktopcategorypanel']">Desktop Category Panel</a>
</li>
Oops, something went wrong.

0 comments on commit 390e78b

Please sign in to comment.