Exemple #1
0
        public MyCountriesViewModelTests(WorldExplorerAPIFactory <Startup> factory)
        {
            _factory = factory;
            _client  = _factory.CreateClient();

            var platformServicesFake = A.Fake <IPlatformServices>();

            Device.PlatformServices = platformServicesFake;
        }
Exemple #2
0
        //Used to mock the platform
        public RegisterViewModelTests(WorldExplorerAPIFactory <Startup> factory)
        {
            _factory = factory;
            WebApplicationFactoryClientOptions options = new WebApplicationFactoryClientOptions();

            options.MaxAutomaticRedirections = 1000;
            options.HandleCookies            = false;
            _client = _factory.CreateClient(options);

            var platformServicesFake = A.Fake <IPlatformServices>();

            Device.PlatformServices = platformServicesFake;
        }
        //Used to mock the platform
        public EditViewModelTests(WorldExplorerAPIFactory <Startup> factory)
        {
            _factory = factory;
            var scope = factory.Services.CreateScope();
            WebApplicationFactoryClientOptions options = new WebApplicationFactoryClientOptions();

            options.MaxAutomaticRedirections = 1000;
            options.HandleCookies            = false;
            _client = _factory.CreateClient(options);

            var platformServicesFake = A.Fake <IPlatformServices>();

            Device.PlatformServices = platformServicesFake;

            var moq = new Mock <UserService>();

            user = new User {
                Id = Guid.Parse("00000000-0000-0000-0000-000000000001"), FirstName = "test", LastName = "test", BirthDate = DateTime.Now.AddYears(-18).Date, Nationality = "testland", Email = "*****@*****.**", Role = "Admin", IsSpotifyDj = false
            };
            var hasher = new PasswordHasher <User>();

            user.Password = hasher.HashPassword(user, "t}F87)8GBaj<");
            token         = moq.Object.GenerateTokenApp(user);
        }