/// <summary> /// Writes the operation result. /// </summary> /// <param name="testItem"></param> public void WriteTestResult(Testing.CSpecTestItem testItem) { if (testItem.TestSucceed) WriteLine(formatter.SuccessResultColor, testItem.Results, true); else WriteLine(formatter.ErrorResultColor, testItem.Results, true); }
static void Main(string[] args) { world = new World(); Testing t = new Testing(); t.playerTesting(); t.eggTesting(); program = new Program(); program.startMenu(); }
public void SetAzureServiceProjectTestsStorageTestsEmptyFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows <ArgumentException>(() => setServiceProjectCmdlet.SetAzureServiceProjectProcess(null, null, string.Empty, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "StorageAccountName")); } }
public void SetAzureServiceProjectTestsLocationEmptyFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows <ArgumentException>(() => new SetAzureServiceProjectCommand().SetAzureServiceProjectProcess(string.Empty, null, null, null, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "Location")); } }
public override void CheckQueue() { if (!queue.IsEmpty() && !GetComponent <ActionExecutor>().Executing&& character.IsFree() && receivingQueue.IsEmpty()) { Action action = queue.Remove(); if (action.Status != Status.ResendSent) { Testing.WriteToLog(transform.name, transform.name + " is executing action: " + Testing.GetActionInfo(action)); } character.currentAction = action; StartCoroutine(Execute(action)); } }
public void ThrowsForUnknownEnvironment() { Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>(); RemoveAzureEnvironmentCommand cmdlet = new RemoveAzureEnvironmentCommand() { CommandRuntime = commandRuntimeMock.Object, Name = "test2" }; Testing.AssertThrows <KeyNotFoundException>( () => cmdlet.ExecuteCmdlet(), string.Format(Resources.EnvironmentNotFound, "test2")); }
public void IgnoresAddingPublicEnvironment() { Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>(); AddAzureEnvironmentCommand cmdlet = new AddAzureEnvironmentCommand() { CommandRuntime = commandRuntimeMock.Object, Name = EnvironmentName.AzureCloud, PublishSettingsFileUrl = "http://microsoft.com" }; int count = GlobalSettingsManager.Instance.GetEnvironments().Count; Testing.AssertThrows <Exception>(() => cmdlet.ExecuteCmdlet()); }
public void ProcessGetWebsiteWithNullSubscription() { // Test var getAzureWebsiteCommand = new GetAzureWebsiteCommand { CommandRuntime = new MockCommandRuntime() }; AzureSession.SetCurrentContext(null, null, null); Testing.AssertThrows <Exception>(getAzureWebsiteCommand.ExecuteCmdlet, Resources.InvalidCurrentSubscription); }
public static int Main(string[] args) { String dataroot = Testing.GetDataRoot(); String filename = dataroot + "/012345.002.050.dcm"; String subdir = "TestReaderUnicode"; String tmpdir = Testing.GetTempDirectory(subdir); process(filename, tmpdir, "ascii.dcm"); process(filename, tmpdir, "ê.dcm"); process(filename, tmpdir, "А.dcm"); return(0); }
public void AddNewCacheWorkerRoleWithInvalidNamesFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { string rootPath = Path.Combine(files.RootPath, "AzureService"); newServiceCmdlet.NewAzureServiceProcess(files.RootPath, "AzureService"); foreach (string invalidName in Test.Utilities.Common.Data.InvalidRoleNames) { Testing.AssertThrows <ArgumentException>(() => addCacheRoleCmdlet.AddAzureCacheWorkerRoleProcess(invalidName, 1, rootPath)); } } }
public async Task Active_apprenticeship_with_single_pause_record_gets_pause_dates() { await Arrange("SFA.DAS.IdentifyDataLocks.IntegrationTests.TestData.ApprenticeshipsWithPausedDates.Active_Apprenticeship_With_Single_Pause_Record.json"); var learner = Testing.CreatePage <LearnerModel>(); learner.Uln = apprenticeship.Uln.ToString(); await learner.OnGetAsync(); learner.CurrentYearDataLocks.First().Apprenticeship.PausedOn.Should().Be(new DateTime(2019, 1, 1)); learner.CurrentYearDataLocks.First().Apprenticeship.ResumedOn.Should().Be(new DateTime(2019, 3, 1)); learner.CurrentYearDataLocks.First().Apprenticeship.CompletionStatus.Should().Be(ApprenticeshipStatus.Active); }
public void GetCmpte() { string arg = "[test] = [test] + 1"; var dict = new Dictionary <string, double>(); dict.Add("test", 1); object actual = 2; Testing t = new Testing(); Assert.AreEqual(t.GetCompute(arg, dict), actual); }
public async Task Arrange() { await Testing.Reset(); await Testing.Context.AddEntitiesFromJsonResource <EarningEventModel>("SFA.DAS.IdentifyDataLocks.IntegrationTests.TestData.LearnerWithMissingApprenticeship.EarningEvents.json"); var dlocks = JsonConvert.DeserializeObject <DataLockEventModel[]>( Resources.LoadAsString("SFA.DAS.IdentifyDataLocks.IntegrationTests.TestData.LearnerWithMissingApprenticeship.Dlock02_DataLocks.json")); await Testing.Context.AddEntities(dlocks); Testing.TimeProvider.Today.Returns(new DateTime(2019, 8, 1)); }
public void GlobalSettingsManagerCreateNewInvalidPublishSettingsFileFail() { foreach (string invalidFileName in Data.InvalidFileName) { Action <ArgumentException> verification = ex => { Assert.AreEqual <string>(ex.Message, Resources.IllegalPath); Assert.IsFalse(Directory.Exists(Data.AzureAppDir)); }; Testing.AssertThrows <ArgumentException>(() => GlobalSettingsManager.CreateFromPublishSettings(Data.AzureAppDir, null, invalidFileName), verification); } }
public When_oauth_callback_is_received() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAccessToken(It.IsAny <string>())).Returns("12345"); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/callback", with => { with.Query("code", "testcode"); }); }
public void SetAzureServiceProjectTestsSlotTestsInvalidFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows <ArgumentException>(() => setServiceProjectCmdlet.SetAzureServiceProjectProcess(null, "MyHome", null, paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Slot")); } }
public When_code_can_not_be_exchanged_for_access_token() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAccessToken(It.IsAny <string>())).Returns((string)null); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/callback", with => { with.Query("code", "testcode"); }); }
public async Task Paused_apprenticeship_gets_latest_pause_dates() { await Arrange("SFA.DAS.IdentifyDataLocks.IntegrationTests.TestData.ApprenticeshipsWithPausedDates.Paused_Apprenticeship.json", true); var learner = Testing.CreatePage <LearnerModel>(); learner.Uln = apprenticeship.Uln.ToString(); await learner.OnGetAsync(); learner.CurrentYearDataLocks.First().Apprenticeship.PausedOn.Should().Be(new DateTime(2018, 6, 7)); learner.CurrentYearDataLocks.First().Apprenticeship.ResumedOn.Should().BeNull(); learner.CurrentYearDataLocks.First().Apprenticeship.CompletionStatus.Should().Be(ApprenticeshipStatus.Paused); }
public void AzureSetDeploymentStorageAccountNameProcessTestsNullFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows <ArgumentException>(() => new SetAzureDeploymentStorageCommand().SetAzureDeploymentStorageProcess(null, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "StorageAccountName")); } }
public virtual void TestSetup() { powershell = PowerShell.Create(); foreach (string moduleName in modules) { powershell.AddScript(string.Format("Import-Module \"{0}\"", Testing.GetTestResourcePath(moduleName))); } powershell.AddScript("$VerbosePreference='Continue'"); powershell.AddScript("$DebugPreference='Continue'"); powershell.AddScript("$ErrorActionPreference='Stop'"); }
public void AzureSetDeploymentLocationProcessTestsInvalidFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows <ArgumentException>(() => new SetAzureDeploymentLocationCommand().SetAzureDeploymentLocationProcess("MyHome", paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Location")); } }
public void Load() { List <Sample> _trainning = new List <Sample>(); List <Sample> _testing = new List <Sample>(); string input = Properties.Resources.optdigits_tra; // Load optdigits dataset into the DataGridView StringReader reader = new StringReader(input); char[] buffer = new char[(32 + 1) * 32]; // 32 chars + \n int count = 0; while (true) { int read = reader.ReadBlock(buffer, 0, buffer.Length); string label = reader.ReadLine(); if (read < buffer.Length || label == null) { break; } var sample = ConvertToSample(buffer, label); if (count > 1000) { _trainning.Add(sample); } else { _testing.Add(sample); } count++; } Testing = _testing; Training = _trainning; if (IsNormalized) { double[][] training = Training.GetInstances(); _mean = training.Mean(dimension: 0); _dev = training.StandardDeviation(); double[][] testing = Testing.GetInstances(); Normalize(training); Normalize(testing); } }
private void AssertCachingEnabled(FileSystemHelper files, string serviceName, string rootPath, string webRoleName, string expectedMessage) { WebRole webRole = Testing.GetWebRole(rootPath, webRoleName); RoleSettings roleSettings = Testing.GetCloudRole(rootPath, webRoleName); AzureAssert.RuntimeUrlAndIdExists(webRole.Startup.Task, Resources.CacheRuntimeValue); Assert.AreEqual <string>(Resources.CacheRuntimeVersionKey, webRole.Startup.Task[0].Environment[0].name); Assert.AreEqual <string>(enableCacheCmdlet.CacheRuntimeVersion, webRole.Startup.Task[0].Environment[0].value); Assert.AreEqual <string>(Resources.EmulatedKey, webRole.Startup.Task[2].Environment[0].name); Assert.AreEqual <string>("/RoleEnvironment/Deployment/@emulated", webRole.Startup.Task[2].Environment[0].RoleInstanceValue.xpath); Assert.AreEqual <string>(Resources.CacheRuntimeUrl, webRole.Startup.Task[2].Environment[1].name); Assert.AreEqual <string>(TestResources.CacheRuntimeUrl, webRole.Startup.Task[2].Environment[1].value); AzureAssert.ScaffoldingExists(Path.Combine(files.RootPath, serviceName, webRoleName), Path.Combine(Resources.CacheScaffolding, Resources.WebRole)); AzureAssert.StartupTaskExists(webRole.Startup.Task, Resources.CacheStartupCommand); AzureAssert.InternalEndpointExists(webRole.Endpoints.InternalEndpoint, new InternalEndpoint { name = Resources.MemcacheEndpointName, protocol = InternalProtocol.tcp, port = Resources.MemcacheEndpointPort }); LocalStore localStore = new LocalStore { name = Resources.CacheDiagnosticStoreName, cleanOnRoleRecycle = false }; AzureAssert.LocalResourcesLocalStoreExists(localStore, webRole.LocalResources); DefinitionConfigurationSetting diagnosticLevel = new DefinitionConfigurationSetting { name = Resources.CacheClientDiagnosticLevelAssemblyName }; AzureAssert.ConfigurationSettingExist(diagnosticLevel, webRole.ConfigurationSettings); ConfigConfigurationSetting clientDiagnosticLevel = new ConfigConfigurationSetting { name = Resources.ClientDiagnosticLevelName, value = Resources.ClientDiagnosticLevelValue }; AzureAssert.ConfigurationSettingExist(clientDiagnosticLevel, roleSettings.ConfigurationSettings); AssertWebConfig(string.Format(@"{0}\{1}\{2}", rootPath, webRoleName, Resources.WebCloudConfig)); AssertWebConfig(string.Format(@"{0}\{1}\{2}", rootPath, webRoleName, Resources.WebConfigTemplateFileName)); Assert.AreEqual <string>(expectedMessage, mockCommandRuntime.VerboseStream[0]); Assert.AreEqual <string>(webRoleName, (mockCommandRuntime.OutputPipeline[0] as PSObject).GetVariableValue <string>(Parameters.RoleName)); }
public async Task ShouldGetProfileSortedBySchoolAsc() { var response = await Testing.Send(new List.Query { Page = 1, SortField = "school", SortBy = "asc" }); var profile = response.Profiles.FirstOrDefault(); profile.ShouldNotBeNull(); profile.Institution.ShouldBe("Arlington"); }
public async Task ShouldGetProfileSortedByIdAsc() { var response = await Testing.Send(new List.Query { Page = 1, SortField = "id", SortBy = "asc" }); var profile = response.Profiles.FirstOrDefault(); profile.ShouldNotBeNull(); profile.StaffUniqueId.ShouldBe("0132398"); }
public void TestRunInstructions() { var instructions = Testing.GetTestFileContents("TestInput.txt").Split(Environment.NewLine); var instructionRunner = new InstructionRunner(instructions); instructionRunner.RunInstructions(); CollectionAssert.AreEquivalent( new Dictionary <string, int> { { "a", 1 }, { "b", 0 }, { "c", -10 } }, instructionRunner.Registers); Assert.AreEqual(10, instructionRunner.MaxValueHeld); }
public void SetAzureServiceProjectRoleInServiecRootDirectoryFail() { string serviceName = "AzureService3"; if (Directory.Exists(serviceName)) { Directory.Delete(serviceName, true); } CloudServiceProject service = new CloudServiceProject(Directory.GetCurrentDirectory(), serviceName, null); service.AddWebRole(Test.Utilities.Common.Data.NodeWebRoleScaffoldingPath); cmdlet.RoleName = string.Empty; Testing.AssertThrows <InvalidOperationException>(() => cmdlet.ExecuteCmdlet(), Resources.CannotFindServiceRoot); }
public void NewAzureRoleTemplateWithWorkerRole() { string outputPath = Path.Combine(Directory.GetCurrentDirectory(), "WorkerRoleTemplate"); addTemplateCmdlet = new NewAzureRoleTemplateCommand() { Worker = true, CommandRuntime = mockCommandRuntime }; addTemplateCmdlet.ExecuteCmdlet(); Assert.Equal <string>(outputPath, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue <string>(Parameters.Path)); Testing.AssertDirectoryIdentical(Path.Combine(Resources.GeneralScaffolding, RoleType.WorkerRole.ToString()), outputPath); }
public async Task ShouldGetProfileSortedByYearsOfServiceAsc() { var response = await Testing.Send(new List.Query { Page = 1, SortField = "yearsOfService", SortBy = "asc" }); var profile = response.Profiles.FirstOrDefault(); profile.ShouldNotBeNull(); profile.YearsOfService.ShouldBe(0); }
public void SerializationTestWithGB18030() { // Setup string outputFileName = "outputFile.txt"; ServiceDefinition serviceDefinition = General.DeserializeXmlFile <ServiceDefinition>( Testing.GetTestResourcePath("GB18030ServiceDefinition.csdef")); // Test File.Create(outputFileName).Close(); General.SerializeXmlFile <ServiceDefinition>(serviceDefinition, outputFileName); // Assert // If reached this point means the test passed }
public void EnableAzureMemcacheRoleProcessOnCacheWorkerRoleFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { string serviceName = "AzureService"; string rootPath = files.CreateNewService(serviceName); string cacheRoleName = "WorkerRole"; string expected = string.Format(Resources.InvalidCacheRoleName, cacheRoleName); addCacheRoleCmdlet.AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, rootPath); Testing.AssertThrows <Exception>(() => enableCacheCmdlet.EnableAzureMemcacheRoleProcess(cacheRoleName, cacheRoleName, rootPath)); } }
public void TestDeploymentSettingsTestNullConfigPathFail() { string label = "MyLabel"; string deploymentName = service.ServiceName; string expectedMessage = string.Format(Resources.InvalidOrEmptyArgumentMessage, Resources.ServiceConfiguration); Testing.AssertThrows <ArgumentException>(() => new PublishContext( settings, packagePath, null, label, deploymentName, rootPath), expectedMessage); }
public static void main() { TestPrimitive(); TestOverflow(); ValueTypeDemo(); TestInitialization(); TestPackaging(); TestPakaging1(); TestPakaging2(); TestEqualityAndIdentity(); TestDynamic(); TestCom(); TestReflection(); // Testing Testing test = new Testing(); test.run(); }
void DoSave() { var Errorlist = new ArrayList(); c1TrueDBGrid1.UpdateData(); if (supplier.EditValue==null) { _ishold = false; XtraMessageBox.Show("Please select the supplier","P.O.S",MessageBoxButtons.OK,MessageBoxIcon.Information); return; } if (warehouse.EditValue == null) { _ishold = false; XtraMessageBox.Show("Please select the warehouse name", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime? dtinv = null; if (invdate.EditValue == null || invdate.EditValue.ToString()==string.Empty) dtinv = null; else dtinv = (DateTime?)invdate.EditValue; string Inv=""; if (invno.EditValue == null) Inv=string.Empty; else Inv = (string)invno.EditValue; if (!_ishold) { if (invno.EditValue==null) { XtraMessageBox.Show("Please enter the invoice no", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (invdate.EditValue == null) { XtraMessageBox.Show("Please enter the invoice date", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (var d in this.dataSet1.PURINVDETAIL) { string t = ""; if (int.Parse(d["qty"].ToString()) == 0) { t = "Quantity not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } if (decimal.Parse(d["invrate"].ToString()) == 0) { t = "Inv.Rate not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } if (decimal.Parse(d["sprice"].ToString()) == 0) { t = "Sales price not found for item : " + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } if (bool.Parse(d["expr"].ToString()) == true && string.IsNullOrEmpty(d["expdate"].ToString())) { t = "Expiry date not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } } } if (CountInvoiceNo() > 0) { XtraMessageBox.Show("Duplicate invoice no found..!,please check the invoice no", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (Errorlist.Count > 0) { var f = new Testing(Errorlist); f.ShowDialog(); return; } Whid = warehouse.EditValue==null ? 0 : int.Parse(warehouse.EditValue.ToString()); try { if (!string.IsNullOrEmpty(_purid)) { _issaved = true; var dr = this.dataSet1.PURINVMAIN.FindByPURINVID(_purid); if (dr != null) { dr.BeginEdit(); dr.SUPID = supplier.EditValue.ToString(); dr.SUPNAME = supplier.Text; dr.INVNO = Inv; if(dtinv==null) dr["INVDATE"] = DBNull.Value; else dr["INVDATE"] = dtinv; dr.DUEDAYS = int.Parse(duedays.EditValue.ToString()); dr.SPDISCOUNT = decimal.Parse(spdisc.EditValue.ToString()); dr.ADJVALUE = decimal.Parse(adjustval.EditValue.ToString()); dr.HOLD = _ishold; dr.WHID = Whid; dr.EUSERID = COMMON.Utils.Userid; dr.EDATE = DateTime.Now; dr.NETVALUE = decimal.Parse(netamt.EditValue.ToString()); dr.EndEdit(); this.purinvmainTableAdapter1.Update(dr); } } else { var InsertQ = new DataSet1TableAdapters.PURINVMAINTableAdapter(); //_purid = Convert.ToInt32(InsertQ.InsertQuery(DateTime.Today.Date, // supplier.EditValue.ToString(), // supplier.Text, // Inv, // dtinv, // int.Parse(duedays.EditValue.ToString()), // decimal.Parse(spdisc.EditValue.ToString()), // decimal.Parse(adjustval.EditValue.ToString()), // _ishold, // Whid, // 0, // COMMON.Utils.Userid, // DateTime.Now, // 0, // null,decimal.Parse(netamt.EditValue.ToString())).ToString()); } if (!string.IsNullOrEmpty(_purid)) { purno.EditValue = _purid; _issaved = true; foreach (DataRow d in this.dataSet1.PURINVDETAIL.Rows) { d["PURINVID"] = _purid; } pURINVDETAILTableAdapter1.Update(this.dataSet1.PURINVDETAIL); if (_ishold) { XtraMessageBox.Show("Invoice holded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { UpdateStock(); XtraMessageBox.Show("Invoice recorded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { XtraMessageBox.Show("Error while saving please try again", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void usingTest(Testing p) {}
public static void Testing(ref Web aretVal) { aretVal = new Testing(); }
void DoSave() { c1TrueDBGrid1.UpdateData(); if (warehouse.EditValue == null) { XtraMessageBox.Show("Please select the from warehouse", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (tostoreid.EditValue == null) { XtraMessageBox.Show("Please select the to store", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime dtinv = DateTime.Parse(invdate.EditValue.ToString()); ArrayList Errorlist = new ArrayList(); if (!ishold) { if (warehouse.EditValue == null) { XtraMessageBox.Show("Please select the from warehouse", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (tostoreid.EditValue == null) { XtraMessageBox.Show("Please select the to store", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (DataRow d in this.dataSet1.ITEMTRANSFERDETAIL) { string t = ""; if (int.Parse(d["qty"].ToString()) > 0) { if (CheckStock(int.Parse(d["stockid"].ToString()), int.Parse(d["qty"].ToString()))) { t = "Sufficent stock not found for item :" + GetItemname((d["ITEMID"].ToString())); Errorlist.Add(t); } } if (decimal.Parse(d["sprice"].ToString()) == 0) { t = "Sales price not found for item : " + GetItemname((d["ITEMID"].ToString())); Errorlist.Add(t); } } } if (Errorlist.Count > 0) { var f = new Testing(Errorlist); f.ShowDialog(); return; } try { if (purid > 0) { issaved = true; var dr = this.dataSet1.ITEMTRANSFERMAIN.FindByTRANID(purid); if (dr != null) { dr.BeginEdit(); dr.FRMSTOREID = int.Parse(warehouse.EditValue.ToString()); dr.TOSTOREID =tostoreid.EditValue.ToString(); dr.HOLD = ishold; dr.EUSERID = COMMON.Utils.Userid; dr.EDATE = DateTime.Now; dr.TOTVALUE = decimal.Parse(netamt.EditValue.ToString()); dr.TOTITEMS = this.dataSet1.ITEMTRANSFERDETAIL.Rows.Count; dr.EndEdit(); this.iTEMTRANSFERDETAILTableAdapter.Update(dr); } } else { var InsertQ = new DataSet1TableAdapters.ITEMTRANSFERMAINTableAdapter(); purid = Convert.ToInt32(InsertQ.InsertQuery(int.Parse(warehouse.EditValue.ToString()), tostoreid.EditValue.ToString(), DateTime.Today.Date, COMMON.Utils.Userid, DateTime.Now, ishold, 0, null , decimal.Parse(netamt.EditValue.ToString()),this.dataSet1.ITEMTRANSFERDETAIL.Rows.Count).ToString()); } if (purid > 0) { textBox1.Text = purid.ToString(); issaved = true; foreach (DataRow d in this.dataSet1.ITEMTRANSFERDETAIL) { d["TRANID"] = purid; } iTEMTRANSFERDETAILTableAdapter.Update(this.dataSet1.ITEMTRANSFERDETAIL); if (ishold) { XtraMessageBox.Show("Invoice holded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { UpdateStock(); GenerateFiles(); XtraMessageBox.Show("Invoice recorded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.posMenu1.SaveButtonEnabled = false; } else { XtraMessageBox.Show("Error while saving please try again", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void SendObject(IPEndPoint connection, Testing.TestClass testobject) { LogFile.WriteLine("testobject name: " + testobject.name); }
public void Initialize(Testing newGameManager) { rB = GetComponent<Rigidbody>(); navUpdateCounter = Random.Range(50, 150); gameManager = newGameManager; }
/// <summary> /// Writes the operation name. /// </summary> /// <param name="testItem"></param> public void WriteTestName(Testing.CSpecTestItem testItem) { WriteLine(formatter.NameColor, testItem.Name, true); }
/// <summary> /// Writes the operation description. /// </summary> /// <param name="testItem"></param> public void WriteTestDescription(Testing.CSpecTestItem testItem) { WriteLine(formatter.DescriptionColor, testItem.Description, true); }
void DoSave() { c1TrueDBGrid1.UpdateData(); if (supplier.EditValue == null) { ishold = false; XtraMessageBox.Show("Please select the supplier", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (warehouse.EditValue == null) { ishold = false; XtraMessageBox.Show("Please select the warehouse name", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime? dtinv = null; if (invdate.EditValue == null) dtinv = null; else dtinv = (DateTime?)invdate.EditValue; ArrayList Errorlist = new ArrayList(); string Inv = ""; if (invno.EditValue == null) Inv = string.Empty; else Inv = (string)invno.EditValue; if (!ishold) { if (invno.EditValue == null) { XtraMessageBox.Show("Please enter the invoice no", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (invdate.EditValue == null) { XtraMessageBox.Show("Please enter the invoice date", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (DataRow d in this.dataSet1.RETURNDETAIL) { string t = ""; if (int.Parse(d["qty"].ToString()) == 0) { t = "Quantity not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } if (string.IsNullOrEmpty(d["bonusqty"].ToString())) { d["bonusqty"] = 0; } if (int.Parse(d["qty"].ToString()) > 0) { if (int.Parse(d["bonusqty"].ToString()) == 0) { if (CheckStock(int.Parse(d["stockid"].ToString()), int.Parse(d["qty"].ToString()))) { t = "Sufficent stock not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } } else if(int.Parse(d["bonusqty"].ToString())> 0) { if (CheckStock(int.Parse(d["stockid"].ToString()), (int.Parse(d["qty"].ToString())) + int.Parse(d["bonusqty"].ToString()))) { t = "Sufficent stock not found for item :" + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } } } if (decimal.Parse(d["invrate"].ToString()) == 0) { t = "Inv.Rate not found for item :" + GetItemname((d["ITEMID"].ToString())); Errorlist.Add(t); } if (decimal.Parse(d["sprice"].ToString()) == 0) { t = "Sales price not found for item : " + GetItemname(d["ITEMID"].ToString()); Errorlist.Add(t); } } } if (invno.EditValue != null) { int t = 0; var ta = new DataSet1TableAdapters.RETURNMASTTableAdapter(); if (purid > 0) { t = (int)ta.GetInvoiceCountWithHold(supplier.EditValue.ToString(), invno.EditValue.ToString(), purid); } else { t = (int)ta.GetInvoiceCount(supplier.EditValue.ToString(), invno.EditValue.ToString()); } if (t > 0) { XtraMessageBox.Show("Duplicate invoice no found..!,please check the invoice no", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } if (Errorlist.Count > 0) { var f = new Testing(Errorlist); f.ShowDialog(); return; } if (warehouse.EditValue == null) whid = 0; else whid = int.Parse(warehouse.EditValue.ToString()); try { if (purid > 0) { issaved = true; var dr = this.dataSet1.RETURNMAST.FindByRETURNID(purid); if (dr != null) { dr.BeginEdit(); dr.SUPID = supplier.EditValue.ToString(); dr.SUPNAME = supplier.Text; dr.INVNO = Inv; if (dtinv == null) dr["INVDATE"] = DBNull.Value; else dr["INVDATE"] = dtinv; dr.SPDISCOUNT = decimal.Parse(spdisc.EditValue.ToString()); dr.ADJVALUE = decimal.Parse(adjustval.EditValue.ToString()); dr.HOLD = ishold; dr.WHID = whid; dr.EUSERID = COMMON.Utils.Userid; dr.EDATE = DateTime.Now; dr.EndEdit(); this.rETURNDETAILTableAdapter.Update(dr); } } else { var InsertQ = new DataSet1TableAdapters.RETURNMASTTableAdapter(); purid = Convert.ToInt32(InsertQ.InsertQuery(DateTime.Today.Date, supplier.EditValue.ToString(), supplier.Text, Inv, dtinv, decimal.Parse(spdisc.EditValue.ToString()), decimal.Parse(adjustval.EditValue.ToString()), decimal.Parse(netamt.EditValue.ToString()), ishold, whid, COMMON.Utils.Userid, DateTime.Now).ToString()); } if (purid > 0) { purno.EditValue = purid; issaved = true; foreach (DataRow d in this.dataSet1.RETURNDETAIL) { d["RETURNID"] = purid; } rETURNDETAILTableAdapter.Update(this.dataSet1.RETURNDETAIL); if (ishold) { XtraMessageBox.Show("Invoice holded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { UpdateStock(); XtraMessageBox.Show("Invoice recorded sucessfully", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } // this.posMenu1.SaveButtonEnabled = false; } else { XtraMessageBox.Show("Error while saving please try again", "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "P.O.S", MessageBoxButtons.OK, MessageBoxIcon.Information); } }