public Souce(
     IFoodProduct decoratedInstance,
     Ingredients.Souce.SouceType souceType) :
     base(decoratedInstance)
 {
     this.souceType = souceType;
 }
Exemple #2
0
        private Ingredients.Souce.Souce GetInstanceUnderTest(SouceType typeOfSouce)
        {
            var foodIngrediantMock = new Mock <IFoodProduct>();

            return(new Ingredients.Souce.Souce(
                       foodIngrediantMock.Object,
                       typeOfSouce));
        }
Exemple #3
0
        public void GetMyOwnCalories_WeightAndTypeSpecified_EmitsWeightAndTypeRelatedCalories(
            SouceType typeOfSouce,
            int expectedCalories)
        {
            var instanceUnderTest = this.GetInstanceUnderTest(typeOfSouce);

            instanceUnderTest.GetMyOwnCalories().Should().Be(expectedCalories);
        }
        private int GetPriceForSouceType(
            SouceType typeOfSouce)
        {
            int price = 0;

            switch (typeOfSouce)
            {
            case SouceType.Tartar:
                price = 200;
                break;

            case SouceType.Hollandeise:
                price = 300;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(typeOfSouce));
            }
            return(price);
        }
        private int GetCaloriesForSouceOfType(
            SouceType typeOfSouce)
        {
            int calories = 0;

            switch (typeOfSouce)
            {
            case SouceType.Tartar:
                calories = 110;
                break;

            case SouceType.Hollandeise:
                calories = 250;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(typeOfSouce));
            }
            return(calories);
        }
    private string getUri(string httpUrl)
    {
        string[] strs = httpUrl.Split('/');
        if (strs.Length < 2)
        {
            Debug.LogError("httpUrl = " + httpUrl + " httpUrl.Split('/').Length < 2 " + httpUrl);
            return("");
        }
        string resource = strs[strs.Length - 1];
        string fold     = strs[strs.Length - 2] + "/";

        string[] str2s = resource.Split('.');
        if (str2s.Length < 2)
        {
            Debug.LogWarning("resource.Split('.').Length < 2 " + httpUrl);
            return("");
        }
        string ResourceName = resource;

        if (souceType == SouceType.Default)
        {
            string name = str2s[0];
            switch (name)
            {
            case "Top":
                souceType    = SouceType.TopView;
                ResourceName = "top." + str2s[str2s.Length - 1];
                break;

            case "top":
                souceType    = SouceType.TopView;
                ResourceName = name + "." + str2s[str2s.Length - 1];
                break;

            case "wallfloor":
                souceType    = SouceType.MaterialTexture;
                ResourceName = name + "." + str2s[str2s.Length - 1];
                break;

            case "model":
                souceType    = SouceType.AssetBoundle;
                ResourceName = name + "." + str2s[str2s.Length - 1];
                break;

            //case "iso":
            //case "thumbnail":
            //case "thumbnail_":
            //break;
            default:
                if (name.IndexOf("thumbnail") != -1)
                {
                    souceType    = SouceType.ResizedImage;
                    ResourceName = "thumbnail." + str2s[str2s.Length - 1];
                }
                break;
            }
        }
        string ending = str2s[str2s.Length - 1];

        switch (ending)
        {
        case "png":
        //case "jpg":
        //    fold = "alluserdata/" + UnityIOSMsg.currentUser.uuid + "/Texture2D/" + fold;
        //    break;
        //case "assetbundle":
        //    fold = "alluserdata/" + UnityIOSMsg.currentUser.uuid + "/Assetbundle/" + fold;
        //    break;
        //case "midf":
        //    fold = "alluserdata/" + UnityIOSMsg.currentUser.uuid + "/OutMidf/" + fold;
        //    break;
        default:
            break;
        }
        return(fold + ResourceName);
    }
Exemple #7
0
 public static IFoodProduct AddSouce(this IFoodProduct instance, SouceType typeOfSouce)
 {
     return(new Souce(instance, typeOfSouce));
 }