public void Setup() { initialHosting = new Application.Domain.Hosting { PrivateCloud = new PrivateCloud { Summary = "A summary", Link = "A link", HostingModel = "A _initialHosting model", RequiresHscn = "A string", }, }; initialHostingJson = JsonConvert.SerializeObject(initialHosting); updatedSummary = "A summary"; updatedLink = "A link"; updatedHostingModel = "A _initialHosting model"; updatedRequiresHscn = "A requires string"; dataMock = new Mock <IUpdatePrivateCloudData>(); dataMock.Setup(d => d.Summary).Returns(() => updatedSummary); dataMock.Setup(d => d.Link).Returns(() => updatedLink); dataMock.Setup(d => d.HostingModel).Returns(() => updatedHostingModel); dataMock.Setup(d => d.RequiresHscn).Returns(() => updatedRequiresHscn); }
public async Task ShouldGetHostingById() { var originalHosting = new Application.Domain.Hosting { PublicCloud = new PublicCloud { Summary = "Some Summary", Link = "www.somelink.com", RequiresHscn = "This Solution requires a HSCN/N3 connection", }, PrivateCloud = new PrivateCloud { Summary = "Private Summary", Link = "www.privatelink.com", HostingModel = "Hosting Model", RequiresHscn = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?", }, HybridHostingType = new HybridHostingType { Summary = "Private Summary", Link = "www.privatelink.com", HostingModel = "Hosting Model", RequiresHscn = "This Solution requires a HSCN/N3 connection", }, OnPremise = new OnPremise { Summary = "Private Summary", Link = "www.privatelink.com", HostingModel = "Hosting Model", RequiresHscn = "This Solution requires a HSCN/N3 connection", }, }; Expression <Func <IHostingResult, bool> > hostingResultExpression = r => r.Id == solutionId && r.Hosting == JsonConvert.SerializeObject(originalHosting); hostingResult = Mock.Of(hostingResultExpression); var newHosting = await context.GetHostingBySolutionIdHandler.Handle( new GetHostingBySolutionIdQuery(solutionId), cancellationToken); newHosting.Should().BeEquivalentTo(originalHosting); }
public void Setup() { summary = "A Summary"; url = "A URL"; requiresHscn = "Requires HSCN"; dataMock = new Mock <IUpdatePublicCloudData>(); dataMock.Setup(d => d.Summary).Returns(() => summary); dataMock.Setup(d => d.Link).Returns(() => url); dataMock.Setup(d => d.RequiresHscn).Returns(() => requiresHscn); hosting = new Application.Domain.Hosting { PublicCloud = new PublicCloud { Summary = summary, Link = url, RequiresHscn = requiresHscn, }, }; hostingJson = JsonConvert.SerializeObject(hosting); }