public void GetTemplates_ExistingTemplateName_OK() { var timestamp1 = MockData.Timestamp(1); repository.Setup(r => r.GetTemplateVersions("T01")).Returns(new List <TemplateContentSummary>() { new TemplateContentSummary() { Name = "T01_V01", TemplateName = "T01", TemplateVersion = "V01", FileName = "T01A.docx", Path = "/files/T01A.docx", Size = 42, Timestamp = timestamp1 }, new TemplateContentSummary() { Name = "T01_V02", TemplateName = "T01", TemplateVersion = "V02", FileName = "T01B.docx", Path = "/files/T01B.docx", Size = 43, Timestamp = MockData.Timestamp(2) }, }); var result = processor.GetTemplates("T01"); Assert.Equal(2, result.Count()); var t1 = result.First(); Assert.Equal("T01", t1.TemplateName); Assert.Equal("T01A.docx", t1.FileName); Assert.Equal("V01", t1.Version); Assert.Equal(timestamp1, t1.Timestamp); Assert.Equal(42, t1.Size); }
public void GetMappings_TemplateNameAndVersion_OK() { repository.Setup(r => r.GetMappings("T01", "V01", null)).Returns(new List <MappingContentSummary>() { new MappingContentSummary() { Name = "T01_V01_M01_V03", TemplateName = "T01", TemplateVersion = "V01", MappingName = "M01", MappingVersion = "V01", FileName = "T01_V01_M01_V03.xlsm", Path = "/files/T01_V01_M01_V03.xlsm", Size = 42, Timestamp = MockData.Timestamp(1) }, new MappingContentSummary() { Name = "T02_V02_M02_V03", TemplateName = "T02", TemplateVersion = "V02", MappingName = "M02", MappingVersion = "V03", FileName = "T02_V02_M02_V03.xlsm", Path = "/files/T02_V02_M02_V03.xlsm", Size = 43, Timestamp = MockData.Timestamp(2) }, }); var result = processor.GetMappings("T01", "V01"); Assert.NotEmpty(result); AssertMappingProperties(result.First()); }