Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

what is the use of occurs 10 or (any number) in the internal table declaration with header line.

1874


Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

1130


19. Given a system that is described with the following equation, X=A+(B.(A̅+C)+C)+A.B.(D̅+E̅) a) Simplify the equation using Boolean Algebra. b) Implement the original and then the simplified equation with a digital circuit. c) Implement the original and then the simplified equation in ladder logic.

1631


How to know we are in home page of a web application using QTP

2386


5. How do you round the addition or subtraction of two numbers in assembler?

2164


what do u mean by tagging

2014


what is the filters in biztakk server? where it can use?

2065


As per interoperatbility programs written in one language can be used by other language. How can we restrict the features of one language (say C#) in the programmer written in another language (say VB)..for example we have some features like operator overloading which is possible C#.NET (not in VB.NET), how can we restrict that when we are using this code in VB.NET.

1892


How does the TCP handle the issue of multiplexing?

2827


i am getting the error while compiling my cics program with including db2 dclgen member it is showing that ur dclgen member not including and all the host variables are undeclared

1572


when we use mantis? how learn mantis?

2126


Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.

1034


I HAVE DONE TESTING TOOLS COURSE,NOW I AM FRESHER,I AM NOT GETTING ANY CALLS,I WANT TO DO THE PROJECT ,WHERE I HAVE TO MEET TO DO THE PROJECT,I AM GOING WITH FAKE EXPERIENCE,SO WHAT I HAVE TO DO.

5237


In an customer exit (include Z) program, only the last record is getting fetched. The exit is getting called after pressing save button. What to write for fetching the first record ? Before saved to a SAP table how can i call all these records in an itab in the exit ?

1917


What is SAP TAO? · Which Version you are using? · What is the Latest Version in SAP TAO? · What are the Advantages in SAP TAO? · What are the Patches required for SAP TAO? · What is BPT? · Difference between BPT & SAP TAO? · Which Framework using for SAP TAO? · What is CBASE? · What is the SAP TAO Architecture? · What are the Prerequisites for SAP TAO? · SAP Solution Manager Mandatory for SAP TAO 1.0? · SAP Solution Manager Mandatory for SAP TAO 2.X? · What is UI Scanner? · What is Inspector? · How many ways to Create a components using TAO 1.0? · How many ways to Create a components using TAO 2.x? · Which service pack required for SAP TAO 2.7? · What is Import/Export? · What is Consolidate?

2867