public void SetAnnexMessageTest() { var statesList = new List <TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "short name")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); }
public void GenerateAnnex(int annexNumber) { data.SetAnnexMessage(annexNumber); MergeToMainDocument(); MergeAnnexNumber(annexNumber); TocText = "Annex " + annexNumber + " - States of transit"; var tableproperties = PropertyHelper.GetPropertiesForViewModel(typeof(TransitStateDetail)); MergeToTable(tableproperties); }
public void OneStateDisplaysInAnnexIfPointNameLengthGreaterThan12Test() { var statesList = new List<TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "long name >12")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); Assert.Equal(string.Empty, vm.MiddleCountry); Assert.Equal(string.Empty, vm.LeftCountry); Assert.Equal(string.Empty, vm.RightCountry); Assert.Equal(1, vm.TransitStateDetails.Count); Assert.Equal("one", vm.TransitStateDetails[0].Country); }
public void OneStateDisplaysInAnnexIfPointNameLengthGreaterThan12Test() { var statesList = new List <TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "long name >12")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); Assert.Equal(string.Empty, vm.MiddleCountry); Assert.Equal(string.Empty, vm.LeftCountry); Assert.Equal(string.Empty, vm.RightCountry); Assert.Equal(1, vm.TransitStateDetails.Count); Assert.Equal("one", vm.TransitStateDetails[0].Country); }
public void MoreThanThreeStatesDisplaysInAnnexTest() { var statesList = new List <TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "two"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "three"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "four"), "short name")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); Assert.Equal(string.Empty, vm.MiddleCountry); Assert.Equal(string.Empty, vm.LeftCountry); Assert.Equal(string.Empty, vm.RightCountry); Assert.Equal(4, vm.TransitStateDetails.Count); Assert.Equal("one", vm.TransitStateDetails[0].Country); Assert.Equal("two", vm.TransitStateDetails[1].Country); Assert.Equal("three", vm.TransitStateDetails[2].Country); Assert.Equal("four", vm.TransitStateDetails[3].Country); }
public void MoreThanThreeStatesDisplaysInAnnexTest() { var statesList = new List<TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "two"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "three"), "short name")); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "four"), "short name")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); Assert.Equal(string.Empty, vm.MiddleCountry); Assert.Equal(string.Empty, vm.LeftCountry); Assert.Equal(string.Empty, vm.RightCountry); Assert.Equal(4, vm.TransitStateDetails.Count); Assert.Equal("one", vm.TransitStateDetails[0].Country); Assert.Equal("two", vm.TransitStateDetails[1].Country); Assert.Equal("three", vm.TransitStateDetails[2].Country); Assert.Equal("four", vm.TransitStateDetails[3].Country); }
public void SetAnnexMessageTest() { var statesList = new List<TransitState>(); statesList.Add(TransitState(CountryFactory.Create(Guid.Empty, "one"), "short name")); var vm = new TransitStateViewModel(statesList); vm.SetAnnexMessage(6); Assert.Equal("See Annex 6", vm.AnnexMessage); }