public void TestCallBuildWithAllDataSetsIncludedAndDuplications_ShouldReturnThirtyOne() { // Arrange var dataSetElements = new DataSetElements(); // Act var dataSetNumber = dataSetElements .WithInfo() .WithInfo() .WithInfo() .WithInfo() .WithVelocity() .WithVelocity() .WithVelocity() .WithVelocity() .WithDecision() .WithTrusted() .WithTrusted() .WithTrusted() .WithTrusted() .Build(); // Assert Assert.AreEqual(31, dataSetNumber); }
public void TestCallBuildWithDeviceInfo_ShouldReturnOne() { // Arrange var dataSetElements = new DataSetElements(); // Act var dataSetNumber = dataSetElements .WithInfo() .Build(); // Assert Assert.AreEqual(1, dataSetNumber); }
public void TestCallBuildWithDeviceInfoAndVelocity_ShouldReturnThree() { // Arrange var dataSetElements = new DataSetElements(); // Act var dataSetNumber = dataSetElements .WithInfo() .WithVelocity() .Build(); // Assert Assert.AreEqual(3, dataSetNumber); }
public void TestCallBuildWithDeviceInfo_Velocity_Decision_ShouldReturnSeven() { // Arrange var dataSetElements = new DataSetElements(); // Act var dataSetNumber = dataSetElements .WithInfo() .WithVelocity() .WithDecision() .Build(); // Assert Assert.AreEqual(7, dataSetNumber); }
private DataSetElements GetDataSetElementsFromExpectedValueAfterBuild(int expectedValue) { var dse = new DataSetElements(); var info = new DataSetElements().WithInfo().Build(); if ((expectedValue & info) == info) { dse.WithInfo(); } var velocity = new DataSetElements().WithVelocity().Build(); if ((expectedValue & velocity) == velocity) { dse.WithVelocity(); } var decision = new DataSetElements().WithDecision().Build(); if ((expectedValue & decision) == decision) { dse.WithDecision(); } var trusted = new DataSetElements().WithTrusted().Build(); if ((expectedValue & trusted) == trusted) { dse.WithTrusted(); } var behavioSec = new DataSetElements().WithBehavioSec().Build(); if ((expectedValue & behavioSec) == behavioSec) { dse.WithBehavioSec(); } if (expectedValue != dse.Build()) { throw new AccessException(AccessErrorType.INVALID_DATA, "Expected value and DataSetElements.Build() value are different."); } return(dse); }