Exemplo n.º 1
0
        public void DomainsApiTests()
        {
            using (MockContext context = MockContext.Start(this.GetType().Name))
            {
                HttpMockServer.Initialize(this.GetType().Name, "DomainsApiTests", RecorderMode);

                ICustomVisionTrainingClient client = GetTrainingClient();

                var domains = client.GetDomainsAsync().Result;
                Assert.Equal(9, domains.Count);

                var foodDomain = domains.FirstOrDefault(d => d.Id == FoodDomain);
                Assert.NotNull(foodDomain);
                Assert.False(foodDomain.Exportable);
                Assert.Contains("food", foodDomain.Name.ToLowerInvariant());

                var generalDomain = client.GetDomainAsync(GeneralDomain).Result;
                Assert.Equal(GeneralDomain, generalDomain.Id);
                Assert.False(generalDomain.Exportable);
                Assert.Contains("general", generalDomain.Name.ToLowerInvariant());
            }
        }