Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to pass object as test case in nunit c#

public static IEnumerable<TestCaseData> CountEqualsZeroAndHouseGrossIsGreaterTestCases
{
    get
    {
        yield return new TestCaseData(report, report.Merchants[4268435971532164].LineItem["EBTPerItem"], 4268435971532164, "EBTPerItem").SetName("ReportMerchantsLineItem");
        yield return new TestCaseData(report, report.Merchants[5461324658456716].AggregateTotals, 5461324658456716, "WirelessPerItem").SetName("ReportMerchantsAggregateTotals");
        yield return new TestCaseData(report, report.AggregateTotals, null, "AggregateTotals").SetName("ReportAggregateTotals");
        yield return new TestCaseData(report, report.AggregateTotals.LineItem["WirelessPerItem"], null, "WirelessPerItem").SetName("ReportAggregateTotalsLineItem");
    }
}
[TestCaseSource("CountEqualsZeroAndHouseGrossIsGreaterTestCases")]
public void DoSanityCheck_WithCountEqualsZeroAndHouseGrossIsGreater_TestCase_SetsWarning(Reports.ResidualsReport report, Reports.LineItemObject container, long? mid, string field)
{
    container.ItemCount = 0;
    container._volume = 0;
    container._houseGross = 1;

    report.DoSanityCheck();

    Assert.IsTrue(report.FishyFlag);
    Assert.That(report.DataWarnings.Where(x=> x is Reports.WarningObjects.ImbalancedVariables && x.mid == mid && x.lineitem == field).Count() > 0);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# convert 1 to 01 
Csharp :: change character velocity unity 
Csharp :: c# odd or even 
Csharp :: get fixedupdate interval unity 
Csharp :: get higest number in MVC 
Csharp :: use & symbole in xml as a text using c# 
Csharp :: add buttons to taskbar thumbnail WPF 
Csharp :: binary search tree c# stackoverflow 
Csharp :: IdentityServer vs JWT vs OAuth? 
Csharp :: How to retrieve a dead letter msg dotnet 
Csharp :: c# linq where value is max and one item 
Csharp :: wpf create rectangle c# 
Csharp :: cqrs design pattern .net core 
Csharp :: how to add a round image unity 
Csharp :: C#$ 
Csharp :: unity3d spin wheel 
Csharp :: how to select class object from query c# 
Csharp :: netmath hack 
Csharp :: c# is not 
Csharp :: c sharp while statement 
Csharp :: c# check number is odd or even 
Csharp :: what is string args in c# 
Csharp :: c# Search specified string inside textbox 
Csharp :: c# string split by length 
Csharp :: how to not overwrite a text file in c# 
Csharp :: Create an array with random values c# 
Csharp :: c# form 
Csharp :: urp set postprocessing value 
Csharp :: block nulltarge tpl dataflow 
Html :: trademark symbol 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =