public void EmptyStartingMaterialTest() { StartingMaterial item = new StartingMaterial(); List <OutputMessage> errors = new List <OutputMessage>(); errors = item.Validate(); Assert.AreNotEqual(0, errors.Count); }
public StartingMaterial TransformToStartingMaterial() { StartingMaterial result = new StartingMaterial(); result.MoleculeCAS = MoleculeCAS; result.n = nValue; result.m = mValue; result.v = VValue; return(result); }
public void SelectedStartingMaterialTest() { molecules.Add(new SelectedMolecule() { Name = "MoleculeA", CAS = "AAAAA-AA-A", Location = "Q2", mAvailable = 25.2 }); StartingMaterial item = new StartingMaterial(molecules[0]); List <OutputMessage> errors = new List <OutputMessage>(); errors = item.Validate(); Assert.AreNotEqual(0, errors.Count); }
private async void GetResourcesCommand() { _logService.Write(this, "Loading reaction with ID " + _reactionId, "debug"); OutputMessages.Add(new OutputMessage() { Message = "Loading reaction...", Level = "debug" }); _reaction = await _dbService.GetReactionAsync(_reactionId); var tmpsm = await _dbService.GetStartingMaterial(_reactionId); var tmpr = await _dbService.GetReagents(_reactionId); var tmps = await _dbService.GetSolvents(_reactionId); var tmpp = await _dbService.GetProducts(_reactionId); var tmpobs = await _dbService.GetObsImgs(_reactionId); _logService.Write(this, "Loaded " + _reactionId, "debug"); OutputMessages.Add(new OutputMessage() { Message = "Loaded", Level = "debug" }); StartingMaterial.Add(tmpsm); foreach (var item in tmpr) { Reagents.Add(item); } _logService.Write(this, Reagents.Count + " reagents loaded for this reaction", "debug"); foreach (var item in tmps) { Solvents.Add(item); } _logService.Write(this, Solvents.Count + " solvents loaded for this reaction", "debug"); foreach (var item in tmpp) { Products.Add(item); } _logService.Write(this, Products.Count + " products loaded for this reaction", "debug"); foreach (var item in tmpobs) { ObservationImgsByteArray.Add(item); } _logService.Write(this, ObservationImgsByteArray.Count + " observable imgs loaded for this reaction", "debug"); ConfigureReactionParameter(); }
public void SelectedAndNotEnoughtVStartingMaterialTest() { molecules.Add(new SelectedMolecule() { Name = "MoleculeA", CAS = "AAAAA-AA-A", Location = "Q2", VAvailable = 63 }); StartingMaterial item = new StartingMaterial(molecules[0]); item.mValueString = ""; item.VValueString = "130"; List <OutputMessage> errors = new List <OutputMessage>(); errors = item.Validate(); Assert.AreNotEqual(0, errors.Count); }