public bool PosTest1() { bool retVal = true; String version = TestLibrary.Generator.GetString(-55, false, 1, 255); String expectedValue = version; String actualValue; TestLibrary.TestFramework.BeginScenario("PosTest1:Create a instance with normal string"); try { SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(version); actualValue = sCVA.Version; if (expectedValue != actualValue) { TestLibrary.TestFramework.LogError("001", "ExpectedValue(" + expectedValue + ") !=ActualValue(" + actualValue + ")"); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("002", "Unexpected exception:" + e); retVal = false; } return retVal; }
public bool PosTest2() { bool retVal = true; String version = TestLibrary.Generator.GetString(-55, false, 256, 512); SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(version); String expectedValue = version; String actualValue; TestLibrary.TestFramework.BeginScenario("PosTest1:Set Version as long String and get it."); try { actualValue = sCVA.Version; if (expectedValue != actualValue) { TestLibrary.TestFramework.LogError("003", "ExpectedValue(" + expectedValue + ") !=ActualValue(" + actualValue + ")"); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("004", "Unexpected exception:" + e); retVal = false; } return retVal; }
public bool PosTest2() { bool retVal = true; String version = TestLibrary.Generator.GetString(-55, false, 256, 512); SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(version); String expectedValue = version; String actualValue; TestLibrary.TestFramework.BeginScenario("PosTest1:Set Version as long String and get it."); try { actualValue = sCVA.Version; if (expectedValue != actualValue) { TestLibrary.TestFramework.LogError("003", "ExpectedValue(" + expectedValue + ") !=ActualValue(" + actualValue + ")"); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("004", "Unexpected exception:" + e); retVal = false; } return(retVal); }
public bool PosTest1() { bool retVal = true; String version = TestLibrary.Generator.GetString(-55, false, 1, 255); String expectedValue = version; String actualValue; TestLibrary.TestFramework.BeginScenario("PosTest1:Create a instance with normal string"); try { SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(version); actualValue = sCVA.Version; if (expectedValue != actualValue) { TestLibrary.TestFramework.LogError("001", "ExpectedValue(" + expectedValue + ") !=ActualValue(" + actualValue + ")"); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("002", "Unexpected exception:" + e); retVal = false; } return(retVal); }
private void Form1_Load(object sender, EventArgs e) { label2.Text = Properties.Resources.String1; Assembly assembly = Assembly.GetExecutingAssembly(); Version version = assembly.GetName().Version; object[] attributes = assembly.GetCustomAttributes(typeof(SatelliteContractVersionAttribute), false); if (attributes.Length > 0) { SatelliteContractVersionAttribute versionAttribute = attributes[0] as SatelliteContractVersionAttribute; } }
public bool NegTest1() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("NegTest1:Create a instance with null string"); try { SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(null); TestLibrary.TestFramework.LogError("005", "No ArgumentNullException throw out expected."); retVal = false; } catch (ArgumentNullException) { } catch (Exception e) { TestLibrary.TestFramework.LogError("006", "Unexpected exception:" + e); retVal = false; } return(retVal); }
public static void ConstructorBasic(string version) { SatelliteContractVersionAttribute scva = new SatelliteContractVersionAttribute(version); Assert.Equal(version, scva.Version); }
public bool NegTest1() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("NegTest1:Create a instance with null string"); try { SatelliteContractVersionAttribute sCVA = new SatelliteContractVersionAttribute(null); TestLibrary.TestFramework.LogError("005", "No ArgumentNullException throw out expected."); retVal = false; } catch (ArgumentNullException) { } catch (Exception e) { TestLibrary.TestFramework.LogError("006", "Unexpected exception:" + e); retVal = false; } return retVal; }