public void XmlBuilder_CreateSlotDetail_PopulatesStringPropertiesThatAreNotNull() { // Arrange var client = new NullClient { Settings = new ClientSettings() }; var slot = new SlotModel(client); var xmlBuilder = new XmlBuilder(client.Preferences); // Act var slotDetail = xmlBuilder.CreateSlotDetail(slot, DateTime.Now); // Assert Assert.IsNotNull(slotDetail.HfmVersion); Assert.IsNotNull(slotDetail.NumberFormat); Assert.IsNotNull(slotDetail.LogFileName); var slotData = slotDetail.SlotData; Assert.IsNotNull(slotData.Core); Assert.IsNotNull(slotData.CoreId); var protein = slotData.Protein; Assert.IsNotNull(protein.ServerIP); Assert.IsNotNull(protein.WorkUnitName); Assert.IsNotNull(protein.Core); Assert.IsNotNull(protein.Description); Assert.IsNotNull(protein.Contact); }
public void XmlBuilder_CreateSlotSummary_PopulatesStringPropertiesThatAreNotNull() { // Arrange var client = new NullClient { Settings = new ClientSettings() }; var slots = new[] { new SlotModel(client) }; var xmlBuilder = new XmlBuilder(client.Preferences); // Act var slotSummary = xmlBuilder.CreateSlotSummary(slots, DateTime.Now); // Assert Assert.IsNotNull(slotSummary.HfmVersion); Assert.IsNotNull(slotSummary.NumberFormat); Assert.AreEqual(1, slotSummary.Slots.Count); var slotData = slotSummary.Slots[0]; Assert.IsNotNull(slotData.Core); Assert.IsNotNull(slotData.CoreId); var protein = slotData.Protein; Assert.IsNotNull(protein.ServerIP); Assert.IsNotNull(protein.WorkUnitName); Assert.IsNotNull(protein.Core); Assert.IsNotNull(protein.Description); Assert.IsNotNull(protein.Contact); }
public string Build(ICollection <SlotModel> slots) { if (slots == null) { throw new ArgumentNullException(nameof(slots)); } Directory.CreateDirectory(Path); var copyHtml = Preferences.Get <bool>(Preference.WebGenCopyHtml); var copyLogs = Preferences.Get <bool>(Preference.WebGenCopyFAHlog); var xmlBuilder = new XmlBuilder(Preferences); var result = xmlBuilder.Build(slots, Path); if (copyHtml) { var htmlBuilder = new HtmlBuilder(Preferences); htmlBuilder.Build(result, Path); } if (copyLogs) { CopyLogs(slots); } return(Path); }
public void XmlBuilder_CreateSlotDetail_PopulatesUpdateDateTimeFromArgument() { // Arrange var client = new NullClient { Settings = new ClientSettings() }; var slot = new SlotModel(client); var updateDateTime = DateTime.Now; var xmlBuilder = new XmlBuilder(client.Preferences); // Act var slotDetail = xmlBuilder.CreateSlotDetail(slot, updateDateTime); // Assert Assert.AreEqual(updateDateTime, slotDetail.UpdateDateTime); }