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
it is a language or tools?
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
why we use mantis? what u mean mantis in IT trends? addvantages of mantis?
write a sql qwery which include joining of two tables 4 marks mainframe
Explain three modes in which files can be accessed from python program
Difference between debugging, running, executing of an application
9.Difference between even and odd signals?explain with the diagram?
what is the difference between read the data from table and infotype
what is difference between object oriented programming structure and object oriented programming system?
what is apt_dump_score in datastage where it is useful
the systematic access of small computers in a distributed data processing system is referred as?
What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
Difference between delegates and Events?
how to convert hashmap to arraylist with iteration
what is session state?