Skip to content

Instantly share code, notes, and snippets.

View chadmichel's full-sized avatar
😀
Working

Chad Michel chadmichel

😀
Working
View GitHub Profile
[DataTestMethod]
[DataRow(1, 2, 3)]
public void Add_Test2(int a, int b, int result)
{
Assert.AreEqual(result, Add(a, b));
}
[TestMethod]
public void Add_Test()
{
Assert.AreEqual(3, Add(1, 2));
}
[DataTestMethod]
[DynamicData(nameof(ProjectTestData), DynamicDataSourceType.Method)]
public void ScheduleEngine_Data_Driven(Project project, Dictionary<int, DateTime> finishDates)
{
Assert.IsNotNull(project);
// Act
var after = ScheduleEngine.CalculateSchedule(project);
// Assert
[TestMethod]
public void ScheduleEngine_Basic_Test()
{
// Arrange
var before = new Project()
{
Start = DateTime.Parse("2020-06-01"),
Activities = new []
{
new Activity()
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:Models="clr-namespace:Models"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" x:Class="Views.Contacts"
Title="{Binding Title}">
<StackLayout>
<SearchBar x:Name="SearchInput" TextChanged="SearchBar_TextChanged"></SearchBar>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Contacts : ContentPage
{
public IContactService ContactService => DependencyService.Get<IContactService>();
public ILocalCacheService LocalCacheService => DependencyService.Get<ILocalCacheService>();
public ObservableCollection<Contact> Items { get; set; }
public Contacts()
{
private static bool _columnEncryptionInitialized = false;
private static ClientCredential _clientCredential;
private static void InitializeColumnEncryption()
{
_clientCredential = new ClientCredential("APP_ID", "APP_SECRET");
var azureKeyVaultProvider =
new SqlColumnEncryptionAzureKeyVaultProvider(GetToken);
import { Component, ViewChild } from '@angular/core';
import { NgTerminal } from 'ng-terminal';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
@ViewChild('theTerm', { static: true }) child: NgTerminal;
<ng-terminal #theTerm></ng-terminal>
@chadmichel
chadmichel / Program.cs
Created March 21, 2020 22:20
CreateHostBuilder for Azure Application Configuration
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
webBuilder.ConfigureAppConfiguration((hostingContext, config) =>
{
Console.WriteLine("Hosting Environment = " + hostingContext.HostingEnvironment.EnvironmentName);
var settings = config.Build();
Console.WriteLine(settings["ConnectionStrings:AppConfig"]);
config.AddAzureAppConfiguration(options =>
options