public async Task HandleAsync_WithCorrectCommand_ShouldReturnWebsite() { // Arrange var websiteId = Guid.NewGuid(); SeedWebsite(websiteId); IServiceScope scope = CreateScope(); var handler = scope.ServiceProvider.GetService <IRequestHandler <GetWebsite, OperationResult <WebsiteOutputModel> > >(); // Act var request = new GetWebsite(websiteId); var getWebsiteOperation = await handler.Handle(request, CancellationToken.None); // Assert getWebsiteOperation.IsSuccessful.Should().BeTrue(); getWebsiteOperation.Errors.Should().BeNull(); getWebsiteOperation.Should().BeOfType(typeof(OperationResult <WebsiteOutputModel>)); WebsiteOutputModel actualWebsite = getWebsiteOperation.Result; actualWebsite.Name.Should().Be("myWebsite"); actualWebsite.Url.Should().Be("www.mysite.com"); actualWebsite.Categories.Count.Should().Be(2); actualWebsite.Categories[0].Should().Be("category 1"); actualWebsite.Categories[1].Should().Be("category 2"); actualWebsite.Image.Name.Should().Be("myImage.png"); actualWebsite.Login.Email.Should().Be("*****@*****.**"); actualWebsite.Login.Password.Should().Be("123456"); }
static void Main(string[] args) { WebClient client = new WebClient(); string a = client.DownloadString("https://raw.githubusercontent.com/Nighty-34/Admin_panel_bulucu-tht/master/admin-panel-bulucu/link.txt"); string[] kes = a.Split('\n'); string read = File.ReadAllText("panel.txt"); string[] kes2 = read.Split('\n'); Basla: Console.WriteLine("Which search type do you want to use? \n 1- Simple Search Total 30 Keywords \n 2- Advanced Search Total " + kes.Length + " Keywords \n 3- Advanced Search-2 Total " + kes2.Length + " Keywords "); string al = Console.ReadLine(); string[] siteler; switch (al) { case "1": siteler = GetWebsite.Sorgula(); Search.Search_(siteler, kes, 30); break; case "2": siteler = GetWebsite.Sorgula(); Search.Search_(siteler, kes, kes.Length); break; case "3": siteler = GetWebsite.Sorgula(); Search.Search_(siteler, kes2, kes2.Length); break; default: Console.WriteLine("You wrote wrong number!"); Console.Clear(); goto Basla; } Console.ReadKey(); }