public void VerifyThatChangeMessageIsProcessed() { this.unitPrefix = new UnitPrefix(Guid.NewGuid(), null, this.uri); this.siteReferenceDataLibrary.UnitPrefix.Add(this.unitPrefix); var row = new UnitPrefixRowViewModel(this.unitPrefix, this.session.Object, null); this.unitPrefix.ShortName = "test"; this.revInfo.SetValue(this.unitPrefix, 10); CDPMessageBus.Current.SendObjectChangeEvent(this.unitPrefix, EventKind.Updated); Assert.AreEqual("test", row.ShortName); }
public void VerifyThatTheConstructorSetsTheProperties() { var shortname = "unitPrefixshortname"; var name = "unitPrefix name"; var conversionFactor = "conversionFactor"; this.unitPrefix = new UnitPrefix(Guid.NewGuid(), null, this.uri) { Name = name, ShortName = shortname, ConversionFactor = conversionFactor, Container = this.siteReferenceDataLibrary }; this.siteReferenceDataLibrary.UnitPrefix.Add(this.unitPrefix); var unitPrefixRowViewModel = new UnitPrefixRowViewModel(this.unitPrefix, this.session.Object, null); Assert.AreEqual(shortname, unitPrefixRowViewModel.ShortName); Assert.AreEqual(name, unitPrefixRowViewModel.Name); Assert.AreEqual(conversionFactor, unitPrefixRowViewModel.ConversionFactor); Assert.AreEqual(this.siteReferenceDataLibrary.ShortName, unitPrefixRowViewModel.ContainerRdl); Assert.AreEqual(0, unitPrefixRowViewModel.ContainedRows.Count); }