refactoring

vnext
Paul Schneider 6 years ago
parent a531a46fb0
commit 11b76834bc
5 changed files with 24 additions and 9 deletions

@ -20,7 +20,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Yavsc.Models.Google
namespace Yavsc.Abstract.Identity
{
/// <summary>
/// Auth token, as they are received.

@ -0,0 +1,9 @@
namespace Yavsc.Abstract.Identity {
public class Me : UserInfo
{
public AuthToken Token {
get;
set;
}
}
}

@ -22,6 +22,7 @@
using System.IO;
using System.Net;
using Newtonsoft.Json;
using Yavsc.Abstract.Identity;
using Yavsc.Models.Google;
namespace Yavsc.GoogleApis

@ -142,7 +142,7 @@ namespace Yavsc.WebApi.Controllers
.Include(u=>u.Roles)
.FirstAsync(u=>u.Id == uid);
var user = new Me(userData.Id, userData.UserName, userData.Email,
var user = new Yavsc.Models.Auth.Me(userData.Id, userData.UserName, userData.Email,
userData.Avatar ,
userData.PostalAddress, userData.DedicatedGoogleCalendar );

@ -14,6 +14,7 @@ using Microsoft.Extensions.Localization;
using Microsoft.Extensions.OptionsModel;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
using Xunit.Abstractions;
using Yavsc;
using Yavsc.Lib;
using Yavsc.Models;
@ -24,21 +25,25 @@ namespace test
public class YavscWorkInProgress : BaseTestContext
{
public void GitClone()
ServerSideFixture _serverFixture;
ITestOutputHelper output;
public YavscWorkInProgress(ServerSideFixture serverFixture, ITestOutputHelper output)
{
this.output = output;
_serverFixture = serverFixture;
}
AppDomain.CurrentDomain.SetData("YAVSC_DB_CONNECTION", "Server=localhost;Port=5432;Database=YavscDev;Username=yavscdev;Password=admin;");
ServiceCollection services = new ServiceCollection();
[Fact]
public void GitClone()
{
YavscMandatory.ConfigureServices(services, testprojectAssetPath, out configuration, out provider);
var dbc = _serverFixture._app.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
var siteConfig = provider.GetRequiredService<IOptions<SiteSettings>>().Value;
var dbc = provider.GetRequiredService<ApplicationDbContext>();
var firstProject = dbc.Projects.FirstOrDefault();
Assert.NotNull (firstProject);
var clone = new GitClone(siteConfig.GitRepository);
var clone = new GitClone(_serverFixture._siteSetup.GitRepository);
clone.Launch(firstProject);
}
}

Loading…