public static RoomState GetRoomState(string stateTypeName) { var list = FindAllDerivedStates(typeof(RoomState)); dynamic returnedValue = new AvailableState(); foreach (var state in list) { if (state.Name == stateTypeName) { returnedValue = (RoomState)Activator.CreateInstance(state); } } return(returnedValue); }
private void CreateOtherProducts() { var searchKeywordsList = new List <SearchKeywords> { new SearchKeywords { Text = "jeans" } }; var searchKeywords1 = new Dictionary <string, List <SearchKeywords> > { { "en", searchKeywordsList } }; var productWithInfo = CreateOrRetrieveByKey <Product, ProductDraft>(client, KeyProductWithInfo, new ProductDraft(), draft => { var productDraft = DefaultProductDraftWithProductType(draft, AvailableProductType); productDraft.Key = KeyProductWithInfo; productDraft.State = AvailableState.ToKeyResourceIdentifier(); productDraft.TaxCategory = AvailableTaxCategory.ToKeyResourceIdentifier(); productDraft.SearchKeywords = searchKeywords1; return(productDraft); }); var productWithoutInfo = CreateOrRetrieveByKey <Product, ProductDraft>(client, KeyProductWithoutInfo, new ProductDraft(), draft => { var productDraft = DefaultProductDraftWithProductType(draft, AvailableProductType); productDraft.Key = null; productDraft.MasterVariant.Prices = new List <PriceDraft>(); //empty prices productDraft.MasterVariant.Sku = null; productDraft.MasterVariant.Key = null; productDraft.MasterVariant.Attributes = null; productDraft.State = null; productDraft.TaxCategory = null; return(productDraft); }); }
public void LockedStateUnitTestSetup() { controlSubstitute = Substitute.For <IControl>(); uut = new AvailableState(); }
public SF_NodeConnector SetAvailable(bool b) { availableState = b ? AvailableState.Available : AvailableState.Unavailable; return(this); }
public void NormalState() { currentState = AvailableState.Normal; }
public void ChallengeState() { currentState = AvailableState.Challenge; }
public DoubleRoom(string roomNumber) { RoomNumber = roomNumber; State = new AvailableState(this); }