you're right. haven't seen the n in "nunit".. nevertheless using (nearly empty) datasource is a way to achieve multiple testruns -> should work with nunit as well.
buchstaben
Posts
-
Is there a way to run nunit Test class 50 times in a loop ? -
Is there a way to run nunit Test class 50 times in a loop ?You could try Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute. I use it to run my test with different testdata:
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
"|DataDirectory|\\MyDataSource.xml",
"Row",
DataAccessMethod.Sequential)] -
XmlSerializer doesn't write the namespaceThat works, thank you. However, I did not expect to need to change the generated code.
-
XmlSerializer doesn't write the namespaceThanks, I've already noticed
XmlSerializerNamespaces
, but this way, I need to code which namespace belongs to which object. But that's exactly what the[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://myNamespace/")]
-attribute says. So how to tell the serializer to have a look for these attributes? I expected that as a default.. -
XmlSerializer doesn't write the namespaceHi there, I'm currently trying to serialize a wsdl.exe generated object
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://myNamespace/")]
public partial class marketDataEventV1 { //...using the following lines of code:
marketDataEventV1 mdEvent = CreateMarketDataEventV1();
XmlSerializer ser = new XmlSerializer(typeof(marketDataEventV1));StringBuilder sb = new StringBuilder();
ser.Serialize(new StringWriter(sb), mdEvent);Now, having a look to
sb.ToString()
shows, that the result (string) does not contain the namespace declaration. I wonder now, how to get the serializer taking account for the namespace?! Thanks in advance! -
Simple Cache shared in multiple application instancesWould be possible, but the application is quite useless until the cache is ready. Nevertheless, I'll invest some more thoughts in this approach. There are 5 flat tables, which each are loaded in a collection. Maybe I should try to parallelise these 5 requests. PS: the cache is used for filter criterions (and the application's main feature is searching/filtering data)
-
Simple Cache shared in multiple application instancesYep, lazy-loading was implemented in former version of the application but didn't satisfy the users due to slow runtime performane.
-
Simple Cache shared in multiple application instancesMy goal is to reduce the application's time of initialisation. Today, every instance creates its own cache, which takes about 30-60 seconds (depending on database's resources). I thought about reducing the time of initialisations to < 5s (for all except the first application's start).
-
Simple Cache shared in multiple application instancesThanks for your answers. What about moving the static collection (cache) to a small library-dll which is referenced from my application. this way, the library-dll would get loaded only one, wouldn't?
-
Simple Cache shared in multiple application instancesHi, I've implemented a very simple cache in a winforms-application using a static Colletion of objects. This collection, of course, is initialized at its first use. As the cache does not need to get updated through the whole application lifetime, that's all I need. My question now is: How to share this static collection through multiple instances of my application? I don't need an extra cache for each instance.. Thanks in adavance.
-
log4net doesn't log in myProcess.OutputDataReceivedHi, my app logs correctly while code is beeing executed within my method
DoIt
. But it doesn't log in theProcess.OutputDataReceived
's EventHandler even ifp_OutputDataReceived
is called. Is there anything I need to look at while usingProcess
?private void DoIt(string arguments) { \_log.Fatal("TEST"); // DOES LOG Process p = new Process(); p.StartInfo.FileName = @"D:\\vssTOOLS\\NetJobs\\UpdateDealArchiveInstrSeq\\UpdateCaller\\bin\\Debug\\UpdateDealArchiveInstrSeq.exe"; p.StartInfo.RedirectStandardError = true; p.StartInfo.RedirectStandardOutput = true; p.OutputDataReceived += new DataReceivedEventHandler(p\_OutputDataReceived); p.ErrorDataReceived += new DataReceivedEventHandler(p\_ErrorDataReceived); p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Caller)).Location); p.StartInfo.UseShellExecute = false; p.StartInfo.Arguments = arguments; p.Start(); p.BeginOutputReadLine(); p.BeginErrorReadLine(); p.WaitForExit(); //Synchronisieren do { System.Threading.Thread.Sleep(100); } while (!p.HasExited); if (p.ExitCode != 0) { // DOES LOG for (int i = 0; i < procOut.ToString().Length; i += 2000) \_log.Info(procOut.ToString().Length > i + 2000 ? procOut.ToString().Substring(i, 2000) : procOut.ToString().Substring(i)); for (int i = 0; i < procErr.ToString().Length; i += 2000) \_log.Error(procErr.ToString().Length > i + 2000 ? procErr.ToString().Substring(i, 2000) : procErr.ToString().Substring(i)); throw new ApplicationException("Es ist ein Fehler aufgetreten: " + procErr.ToString()); } } StringBuilder procOut = new StringBuilder(); StringBuilder procErr = new StringBuilder(); void p\_ErrorDataReceived(object sender, DataReceivedEventArgs e) { procErr.AppendLine(e.Data); \_log.Error(e.Data); // DOES NOT LOG } void p\_OutputDataReceived(object sender, DataReceivedEventArgs e) { procOut.AppendLine(e.Data); \_log.Info(e.Data); // DOES NOT LOG }
-
NHibernate: getting the available row count while using maxResultsI've found the solution:
criteria.SetProjection(Projections.RowCount());
int totalRecordsFound = (int)criteria.UniqueResult(); -
NHibernate: getting the available row count while using maxResultsHi, I've done some hibernate work querying data from oracle. Since the return might be a very huge list of objects, I use the SetMaxResults() method.
int maxDS = 1000;
ISession session = //..
ICriteria criteria = session.CreateCriteria(typeof(Trade));
criteria.SetMaxResults(maxDS);
AddCriterions(criteria); // I add some criterions in this method
IList<Trade> trades = criteria.List<Trade>();How can I get the number of totally available objects (for my criterions) without disposing maxDS and loading them all? Thanks in advance.
-
Where does Settings.Default.MySetting come from?Simon Stevens wrote:
The default value is hard coded as an attribute on the property
Thanks, that's what I've been looking for.
-
Where does Settings.Default.MySetting come from?Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?
-
what is java's Logger.getRootLogger() in log4net?Hi, can anyone tell me the c# way to get the log4net root logger? background: there's a dll wich executes any code specified via xml (dest. assembly path, dest. method, etc.). within this dll, log4net is correctly configured and works fine. now i want to use the same logger from any of my dest. dlls. calling
LogManager.GetRepository()
and navigating through some public and private fields via visual studio tells that both appenders (configured in base dll) are available. But how to access them? -
nunit-console doesnt stop after test summary outputusing the /nothread option helped, but i still don't know why :/
-
Merge to xml-files by C#guess it depends on how the merge should work. if you only need to append one file to another, cmd.exe will do the job. xslt is fine, but you'll need something that starts the transformation process automatically.
-
nunit-console doesnt stop after test summary outputHi, anyone famliar with nunit-console.exe? running tests of a dll works fine, but after the test summary is printed, I don't come back to the cmd, except by typing ctrl+c. This behaviour always occurs , ignoring test results. Any idea?
...................................
Tests run: 75, Failures: 1, Not run: 0, Time: 236.123 secondsFailures:
- #failure info#
#stack trace#
^C
D:\Profiles\myname>thanks in advance.
- #failure info#
-
My computer can't do basic arithmetic (or I'm doing something stupid)try
float aspectRatio = 1280f / 500f;
what you're doing is calculating with integers and assigning the result to float. you need to calculate with floats.