コード例 #1
0
        public FileStreamResult Get(string assembly, string resource, string folders)
        {
            SetFromQueryStringIfEmpty(ref assembly, nameof(assembly));
            SetFromQueryStringIfEmpty(ref resource, nameof(resource));
            SetFromQueryStringIfEmpty(ref folders, nameof(folders));

            return(EmbeddedResource.Get(assembly, resource, folders));
        }
コード例 #2
0
        public void ThrowsSoapFaultWhenFault()
        {
            string xml = EmbeddedResource.Get <CreateReportResponseTests>("SoapFaultResponse.txt");
            CreateReportResponse sut = new CreateReportResponse();

            var soapFaultException = Assert.Throws <SoapFaultException>(() => sut.LoadFromXml(xml));

            Assert.NotNull(soapFaultException.SoapFault);
        }
コード例 #3
0
        public void ParseResponse()
        {
            string xml = EmbeddedResource.Get <GetPicklistKeywordsResponseTests>("GetPicklistKeywordsResponse.txt");

            GetPicklistKeywordsResponse sut = new GetPicklistKeywordsResponse();

            sut.LoadFromXml(xml);

            Assert.NotEmpty(sut.Values);
        }
コード例 #4
0
        private XDocument getTemplate(string deviceName)
        {
            var resourceName = "DVST_" + deviceName;

            if (EmbeddedResource.Contains(resourceName))
            {
                using (Stream source = EmbeddedResource.Get(resourceName))
                    return(XDocument.Load(source));
            }
            return(null);
        }
コード例 #5
0
        public void ParseResponse()
        {
            string xml = EmbeddedResource.Get <CreateReportResponseTests>("CreateResponse.txt");
            CreateReportResponse sut = new CreateReportResponse();

            sut.LoadFromXml(xml);

            Assert.Equal("Control4222019144914-embcTraining-159742987459901082006", sut.Fields["reportId"]);
            Assert.Equal("Control4222019144914-embcTraining-159742987459901082006", sut.Fields["id"]);
            Assert.Equal("resource_request", sut.Fields["reportType"]);
        }
コード例 #6
0
        public void EmbeddedResource_RetrieveResource()
        {
            var sql = EmbeddedResource.Get("DataPointBatchClient.Scripts.InsertPatient.sql");

            Assert.AreNotEqual(sql, null);
        }
コード例 #7
0
 protected BatchDestinationRepository(string resourcePath, CancellationToken token)
 {
     Query  = EmbeddedResource.Get(resourcePath);
     _token = token;
 }
コード例 #8
0
 public HttpCachedEmbeddedFile(string path) : base(path, EmbeddedResource.Get(path))
 {
     this.embedded     = true;
     this.LastModified = DateTime.UtcNow;
 }