public void GatherSystemInformationTO_CanAdd_ResultHasData_ReturnTrue() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO { Result = "Value" }; //------------Assert Results------------------------- Assert.IsTrue(gatherSystemInformationTO.CanAdd()); }
public void GatherSystemInformationTO_CanAdd_ResultEmpty_ReturnFalse() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO { Result = string.Empty }; //------------Assert Results------------------------- Assert.IsFalse(gatherSystemInformationTO.CanAdd()); }
public void GatherSystemInformationTOShouldImplementIDev2TOFn() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- GatherSystemInformationTO informationTO = new GatherSystemInformationTO(); //------------Assert Results------------------------- Assert.IsInstanceOfType(informationTO,typeof(IDev2TOFn)); }
public void ConstructorWhereParametersExpectSetsProperties() { //------------Setup for test-------------------------- const string ResultVariable = "[[Output]]"; var toGather = enTypeOfSystemInformationToGather.OperatingSystem; const int IndexNumber = 0; //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO(toGather,ResultVariable,IndexNumber); //------------Assert Results------------------------- Assert.IsNotNull(gatherSystemInformationTO); Assert.AreEqual(ResultVariable,gatherSystemInformationTO.Result); Assert.AreEqual(toGather,gatherSystemInformationTO.EnTypeOfSystemInformation); Assert.AreEqual(IndexNumber,gatherSystemInformationTO.IndexNumber); }
public void ConstructorWhereParametersExpectSetsProperties() { //------------Setup for test-------------------------- const string ResultVariable = "[[Output]]"; const enTypeOfSystemInformationToGather TOGather = enTypeOfSystemInformationToGather.OperatingSystem; const int IndexNumber = 0; //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO(TOGather, ResultVariable, IndexNumber); //------------Assert Results------------------------- Assert.IsNotNull(gatherSystemInformationTO); Assert.AreEqual(ResultVariable, gatherSystemInformationTO.Result); Assert.AreEqual(TOGather, gatherSystemInformationTO.EnTypeOfSystemInformation); Assert.AreEqual(IndexNumber, gatherSystemInformationTO.IndexNumber); }
public void GatherSystemInformationTO_CanRemove_ResultWithData_ReturnFalse() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO { Result = "Value" }; //------------Assert Results------------------------- Assert.IsFalse(gatherSystemInformationTO.CanRemove()); }
void ExecuteForTO(IDSFDataObject dataObject, int update, ErrorResultTO allErrors, GatherSystemInformationTO item) { var val = GetCorrectSystemInformation(item.EnTypeOfSystemInformation); var expression = item.Result; var regions = DataListCleaningUtils.SplitIntoRegions(expression); if (regions.Count > 1) { allErrors.AddError(ErrorResource.MultipleVariablesInResultField); } else { foreach (var region in regions) { dataObject.Environment.AssignWithFrame(new AssignValue(region, val), update); } } }