public void ClientAndServiceStartAndCanCommunicate() { const string address = "http://localhost:5110"; using( var host = new RecipeBookHost( address ) ) using( var recipes = new RecipeBookClient( address ) ) { Assert.IsNotNull( host ); Assert.IsNotNull( recipes ); Assert.DoesNotThrow( () => { var x = recipes.AllDrinks; } ); } }
static int Main() { const string address = "http://localhost:5110"; using( var recipes = new RecipeBookClient( address ) ) { recipes.Add( new LocalDrink( "G&T", "Mix with ice and lime", new[] { new Ingredient( "Gin", Measurement.Measure, 2 ), new Ingredient( "Tonic Water", Measurement.Fill, 1 ) } ) ); foreach (var d in recipes.AllDrinks) { Console.WriteLine( d.Name ); } } Console.WriteLine( "Press [Enter] to exit" ); Console.ReadLine(); return 0; }