Building Quotation engine program

Answer Posted / perfdev

TravelInsuranceQuoteTests --> DataLayer --> CustomerPremiumTests.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Core;
using NUnit.Framework;
using TravelInsuranceQuote.DataLayer;

namespace TravelInsuranceQuoteTests.DataLayer
{
[TestFixture]
public class CustomerPremiumTests
{
[Test]
public void CustomerPremium_CanCreateObject()
{
var customerPremium = new CustomerPremium();
Assert.That(customerPremium, Is.Not.Null);
Assert.That(customerPremium, Is.TypeOf<CustomerPremium>());
}

[Test]
public void CustomerPremium_CanSetProperties()
{
var customerPremium = new CustomerPremium
{
Base = 10.00,
Age = new double[] { 20.00, 4.00 },
Sex = new double[] { 20.00, 4.00 },
Destination = new double[] { 20.00, 4.00 },
TravelPeriod = new double[] { 20.00, 4.00 },
Tax = new double[] { 20.00, 4.00 },
Total = 30.00

};
Assert.That(customerPremium.Base, Is.EqualTo(10.00));
Assert.That(customerPremium.Age[0], Is.EqualTo(20.00));
Assert.That(customerPremium.Sex[1], Is.EqualTo(4.00));
Assert.That(customerPremium.Destination[0], Is.EqualTo(20.00));
Assert.That(customerPremium.TravelPeriod[1], Is.EqualTo(4.00));
Assert.That(customerPremium.Tax[0], Is.EqualTo(20.00));
Assert.That(customerPremium.Total, Is.EqualTo(30.00));
}
}
}

#####################

CustomerTests.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Core;
using NUnit.Framework;
using TravelInsuranceQuote.DataLayer;

namespace TravelInsuranceQuoteTests.DataLayer
{
[TestFixture]
public class CustomerTests
{
[Test]
public void Customer_CanCreateObject()
{
var customer = new Customer();
Assert.That(customer, Is.Not.Null);
Assert.That(customer, Is.TypeOf<Customer>());
}

[Test]
public void Customer_CanSetProperties()
{
var customer = new Customer {
TripType = TripType.Single,
Sex = Sex.Male,
Destination = Destination.Europe,
Age = 20,
TravelPeriod = 1
};
Assert.That(customer.TripType, Is.EqualTo(TripType.Single));
Assert.That(customer.Sex, Is.EqualTo(Sex.Male));
Assert.That(customer.Destination, Is.EqualTo(Destination.Europe));
Assert.That(customer.Age, Is.EqualTo(20));
Assert.That(customer.TravelPeriod, Is.EqualTo(1));
}
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

it is a language or tools?

1615


Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1746


why we use mantis? what u mean mantis in IT trends? addvantages of mantis?

1731


write a sql qwery which include joining of two tables 4 marks mainframe

1479


Explain three modes in which files can be accessed from python program

1314






Difference between debugging, running, executing of an application

3479


9.Difference between even and odd signals?explain with the diagram?

2947


what is the difference between read the data from table and infotype

2044


what is difference between object oriented programming structure and object oriented programming system?

1432


what is apt_dump_score in datastage where it is useful

1484


the systematic access of small computers in a distributed data processing system is referred as?

2712


What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

7163


Difference between delegates and Events?

1703


how to convert hashmap to arraylist with iteration

1189


what is session state?

1512