Пример #1
0
        [Step(@"^(\d+) services available$")] public void ServicesAvailable(string[] matches)
        {
            int available = int.Parse(matches[0]);

            Assert.IsTrue(available < 10, "Maximum of 10 mock services allowed");
            assetEditor.Load("AdzeServicesManager", "Decoupler.Services", serviceDirectory);
            adzeServicesManager = assetEditor.Asset("AdzeServicesManager") as AdzeServicesManager;
            Assert.NotNull(adzeServicesManager);
            string mockIndexes = "";

            using (var list = Fifo <string> .Instance) {
                foreach (AdzeServiceAdapter service in adzeServicesManager.ServiceList)
                {
                    var mock = service as AdzeServiceForMock;
                    if (mock != null)
                    {
                        var name = mock.GetType().Name;
                        list.Push(name);
                        assetEditor.Load(name, "Decoupler.Services", serviceDirectory);
                        mockIndexes += name[name.Length - 1];
                    }
                }
                for (int i = 1; i <= available; i++)
                {
                    if (!mockIndexes.Contains(i.ToString()))
                    {
                        var assetName = $"AdzeServiceForMock {i}";
                        assetEditor.Load(assetName, "Decoupler.Services", serviceDirectory);
                        list.Push(assetName);
                        assetEditor.InsertIntoArrayField("AdzeServicesManager", "services", assetName);
                    }
                }
                mocks = list.ToArray();
            }
        }
 [Step(@"^we open the concrete service wizard$")] public void OpenWizard()
 {
     PrepareNewService();
     assetEditor.Load(concreteWizard = $"{serviceName}Wizard", "Decoupler.Services", serviceDirectory);
 }