Questions tagged [c#]

Use for questions about testing using C#. This can include unit tests, integration tests, UI tests. If a programmed test uses C#, and the question relates to testing rather than to code, the C# tag should be used.

C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft for use with its .NET framework.

C# is one of the programming languages designed for the Common Language Infrastructure.

C# is a general-purpose, object-oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 6.0 which was released in 2015.

476 questions
6
votes
1 answer

What's the best way to test log4net logging?

What's the best way to test log4net logging? As logging is to some degree an interface to our component, I want to make sure it keeps working as it can be configured in a few different ways. Should we write a custom appender or is there one out…
Squirrel
  • 809
  • 6
  • 7
4
votes
1 answer

Unit tests: avoiding overspecification

Say I have the following method that sends emails. I know I should have tests for the different status codes returned. I am also testing if the the methods CreateMail() and Send() are being called. I guess in the end what's important is if the…
ThunderDev
  • 153
  • 2
1
vote
0 answers

Two way authentication okta testing?

I am not sure if this is possible. I was task of getting an access token from okta. The problem is okta is using a two way authentication system where it will send a push notification on your phone and you will have to click the button yes on…
thenewbie
  • 119
  • 2
1
vote
1 answer

(C#) Error in Loop for with If in a string search

Even finding the desired value in the register vector displays the message "TP não encontrado". I need that when the value is found it does not display the message that was not found. for (int i = 0; i < cadastro_tp.Length; i++) { if…
Ronison Matos
  • 229
  • 4
  • 9
-2
votes
1 answer

Find out if nested class is zero

I have a class "Data" and a subclass "SubData". I want to access a method in SubData. In order to do something like: value = Data.SubData.getValue(); I need to make sure that Data!=null and also that SubData!=null. I would usually do this: if…