public void Double_saved_payments_processing() { var payers = session.Query <Payer>().Where(p => p.INN == "361911638854").ToList(); payers.Each(p => { p.INN = null; session.Save(p); }); var payer = DataMother.CreatePayerForBillingDocumentTest(); payer.INN = "361911638854"; session.Save(payer); session.Flush(); var file = "../../../TestData/1c.txt"; using (var stream = File.OpenRead(file)) Context.Session["payments"] = Payment.Parse(file, stream); Reopen(); controller.SavePayments(); try { Reopen(); controller.SavePayments(); } catch (SessionExpiredException) { } session.Refresh(payer); Assert.That(payer.Balance, Is.EqualTo(3000)); }
public void Search_should_return_offers() { var client = DataMother.CreateTestClientWithUser(); var offers = Offer.Search(session, client.Users[0], "папа"); Assert.That(offers.Count, Is.GreaterThan(0)); }
public void SetUp() { user = DataMother.CreateSupplierUser(); supplier = (Supplier)user.RootService; payer = DataMother.CreatePayer(); session.Save(payer); }
public void FilterGetAllDocumentsIfNoOnlyNoParsedTest() { // Создаем поставщика var supplier = DataMother.CreateSupplier(); Save(supplier); var client = DataMother.CreateTestClientWithAddress(); Save(client); // Создаем много документов, чтобы не влезали на одну страницу for (int i = 0; i < 33; i++) { var documentLog = new DocumentReceiveLog(supplier); documentLog.ForClient = client; Save(documentLog); } // Создаем фильтр и устанавливаем параметр Только неразобранные var filter = new DocumentFilter(); filter.Supplier = supplier; filter.OnlyNoParsed = true; var documents = filter.Find(session); // должны получить документы в количестве равном одной странице Assert.That(documents.Count, Is.EqualTo(filter.PageSize)); // ищем все документы filter.OnlyNoParsed = false; documents = filter.Find(session); // должны получить документы в количестве большем одной страницы Assert.That(documents.Count, Is.GreaterThan(filter.PageSize)); }
public void Move_only_address_to_another_client() { var oldClient = DataMother.CreateTestClientWithAddressAndUser(); var newClient = DataMother.CreateTestClientWithAddressAndUser(); var address = oldClient.Addresses[0]; var addressIdForMove = address.Id; Open(address); browser.TextField(Find.ById("TextForSearchClient")).TypeText(newClient.Id.ToString()); browser.Button(Find.ById("SearchClientButton")).Click(); Thread.Sleep(2000); Assert.IsTrue(browser.SelectList(Find.ById("clientsList")).Exists); Assert.That(browser.SelectList(Find.ById("clientsList")).Options.Count, Is.GreaterThan(0)); Assert.IsTrue(browser.Button(Find.ByValue("Отмена")).Exists); Assert.IsTrue(browser.Button(Find.ByValue("Переместить")).Exists); ClickButton("Переместить"); AssertText("Адрес доставки успешно перемещен"); AssertText(newClient.Name); Assert.That(browser.Text, Is.Not.StringContaining(oldClient.Name)); session.Refresh(oldClient); session.Refresh(newClient); address = session.Load <Address>(addressIdForMove); Assert.That(address.Client.Id, Is.EqualTo(newClient.Id)); Assert.That(newClient.Addresses.Count, Is.EqualTo(2)); Assert.That(oldClient.Addresses.Count, Is.EqualTo(0)); }
public void SetUp() { controller = new ClientsController(); referer = "http://ya.ru"; Prepare(controller); client = DataMother.CreateTestClientWithUser(); }
public void Try_to_register_with_existing_payer() { var payerClient = DataMother.TestClient(); session.SaveOrUpdate(payerClient); var payer = payerClient.Payers.First(); payer.Name = "Тестовый плательщик " + payer.Id; session.SaveOrUpdate(payer); Refresh(); SetupGeneralInformation(); SearchPayer(String.Format("Тестовый плательщик {0}", payer.Id)); Css("#PayerComboBox").Select(String.Format("{0}. Тестовый плательщик {0}", payer.Id)); Assert.That(Css("#options_FillBillingInfo").Enabled, Is.False); browser.Button(Find.ById("RegisterButton")).Click(); var client = GetRegistredClient(); Assert.That(client.Payers.First().Id, Is.EqualTo(payer.Id)); var settings = client.Settings; Assert.That(settings.InvisibleOnFirm, Is.EqualTo(DrugstoreType.Standart)); Assert.That(settings.FirmCodeOnly, Is.Null); }
public void Move_user_with_logs() { var oldClient = DataMother.CreateTestClientWithAddressAndUser(); var user = oldClient.Users[0]; var address = oldClient.Addresses[0]; user.AvaliableAddresses = new List <Address>(); address.AvaliableForUsers.Add(user); var newClient = DataMother.CreateTestClientWithAddressAndUser(); controller.MoveUserOrAddress(newClient.Id, user.Id, address.Id, newClient.Orgs().First().Id, false); session.Flush(); session.Refresh(oldClient); session.Refresh(newClient); var records = session.Query <AuditRecord>() .Where(l => l.Service == newClient && l.ObjectId == user.Id) .ToList(); Assert.That(user.Client.Id, Is.EqualTo(newClient.Id)); Assert.That(newClient.Users.Count, Is.EqualTo(2)); Assert.That(oldClient.Users.Count, Is.EqualTo(0)); Assert.That(records.Count, Is.EqualTo(3), records.Implode()); Assert.That(records.Implode(), Is.StringContaining("Перемещение пользователя от")); }
public void Register_client_for_supplier_with_payer() { var supplier = DataMother.CreateSupplier(); MakeNameUniq(supplier.Payer); MakeNameUniq(supplier); Refresh(); SetupGeneralInformation(); SearchPayer(supplier.Payer.Name); Assert.That(Css("#PayerComboBox").Options.Count, Is.EqualTo(1)); Assert.That(Css("#PayerComboBox").SelectedItem, Is.StringEnding(supplier.Payer.Name)); Css("#ShowForOneSupplier").Click(); SearchSupplier(supplier.Name); Assert.That(Css("#SupplierComboBox").Options.Count, Is.EqualTo(1)); Assert.That(Css("#SupplierComboBox").SelectedItem, Is.StringEnding(supplier.Name)); Click("Зарегистрировать"); var client = GetRegistredClient(); Assert.That(client.Payers[0], Is.EqualTo(supplier.Payer)); Assert.That(client.Settings.NoiseCosts, Is.True); Assert.That(client.Settings.NoiseCostExceptSupplier, Is.EqualTo(supplier)); }
public void Show_smart_order_rule_parser_configuration() { var supplier = DataMother.CreateSupplier(s => { s.Name = "Поставщик для тестирования"; s.FullName = "Поставщик для тестирования"; s.AddPrice("Ассортиментный прайс", PriceType.Assortment); }); session.Save(supplier); FlushAndCommit(); //отключаем Css("#drugstore_EnableSmartOrder").Click(); //включаем Css("#drugstore_EnableSmartOrder").Click(); SearchV2("#drugstore_SmartOrderRules_ParseAlgorithm", "DbfSource"); Assert.IsTrue(Css("#drugstore_SmartOrderRules_CodeColumn").Displayed); Assert.IsFalse(Css("#drugstore_SmartOrderRules_StartLine").Displayed); Click("Сохранить"); Assert.AreEqual(Error("#drugstore_SmartOrderRules_QuantityColumn"), "Это поле необходимо заполнить."); Assert.AreEqual(Error("#drugstore_SmartOrderRules_ProductColumn"), "Это поле необходимо заполнить."); SearchV2("#drugstore_SmartOrderRules_AssortimentPriceCode_Id", "Поставщик для тестирования"); Css("#drugstore_SmartOrderRules_ProductColumn").SendKeys("F1"); Css("#drugstore_SmartOrderRules_QuantityColumn").SendKeys("F2"); Click("Сохранить"); AssertText("Сохранено"); session.Refresh(settings.SmartOrderRules); Assert.AreEqual(settings.SmartOrderRules.ProductColumn, "F1"); }
public void Move_last_user_to_another_client() { var oldClient = DataMother.CreateTestClientWithAddressAndUser(); var oldUser = oldClient.Users[0]; var address = oldClient.Addresses[0]; oldUser.AvaliableAddresses = new List <Address>(); address.AvaliableForUsers.Add(oldUser); var newClient = DataMother.CreateTestClientWithAddressAndUser(); controller.MoveUserOrAddress(newClient.Id, oldUser.Id, address.Id, newClient.Orgs().First().Id, false); controller.SendMails(); session.Flush(); session.Refresh(oldClient); session.Refresh(newClient); session.Refresh(oldUser); Assert.That(oldUser.Client.Id, Is.EqualTo(newClient.Id)); Assert.That(newClient.Users.Count, Is.EqualTo(2)); Assert.That(oldClient.Users.Count, Is.EqualTo(0)); Assert.That(newClient.Addresses.Count, Is.EqualTo(1)); Assert.That(oldClient.Addresses.Count, Is.EqualTo(1)); Assert.That(oldClient.Status, Is.EqualTo(ClientStatus.On)); Assert.That(Emails.FirstOrDefault(m => m.Subject.Contains("Перемещение пользователя")), Is.Not.Null, "не могу найти уведомление о перемещении"); }
public void SetUp() { hierarchy = DataMother.BuildHierarchy( @" t1,Success t2,Failure t3,Success s1/t4,Success s1/t5,Success s1/t6,Failure "); events = MockRepository.GenerateMock <IEventAggregator>(); view = new StubExplorerView(); explorer = new TestExplorer(view, events, null, new TestFilter(), null); explorer.Handle(hierarchy); var suite = new Suite("NewSuite"); hierarchy.FindSuite("s1").AddSuite(suite); explorer.HandleMessage(new SuiteAddedMessage { NewSuite = suite }); }
protected override void beforeEach() { MockFor <IExecutionQueue>().Expect(x => x.GetAllQueuedTests()).Return(new Test[0]); MockFor <IExecutionQueue>().Expect(x => x.IsExecuting()).Return(true); ClassUnderTest.Activate(DataMother.ScreenObjectRegistry()); }
public void Calculate_sum() { DataMother.TestClient(c => { c.Payers.Clear(); c.Payers.Add(payer); }); var act = new Act(payer, DateTime.Now); act.Parts.Add(new ActPart(act) { Name = "Тест", Count = 1, Cost = 100 }); act.CalculateSum(); session.Save(act); var filter = new PayerDocumentFilter { Region = payer.Clients.First().HomeRegion, SearchText = payer.Id.ToString() }; var acts = filter.Find <Act>(session); Assert.AreEqual(100, filter.Sum); Assert.AreEqual(1, acts.Count); }
public void ShowTest() { var client = DataMother.CreateClientAndUsers(); var user = client.Users.First(); var afUpdate = new UpdateLogEntity(user); var supplier = DataMother.CreateSupplier(); var document = new FullDocument { Supplier = supplier, ClientCode = client.Id }; var line = document.NewLine(new DocumentLine { Product = "TestCertificateRequestLogProduct" }); var nuSert = new CertificateRequestLog { Line = line, Update = afUpdate }; Save(afUpdate, supplier, document, nuSert); Open("Main/Stat"); Css("#StatisticsTD a").Click(); AssertText("Статистика по сертификатам"); var otherRegion = session.QueryOver <Region>().List().Last(); Css("#filter_Region_Id").SelectByValue(otherRegion.Id.ToString()); Click("Показать"); Assert.That(browser.Text, !Is.StringContaining("TestCertificateRequestLogProduct")); Css("#filter_Region_Id").SelectByValue(client.MaskRegion.ToString()); Click("Показать"); AssertText("TestCertificateRequestLogProduct"); }
public void Request_for_not_exist_name_should_return_zero_elements() { var client = DataMother.CreateTestClientWithUser(); var offers = Offer.Search(session, client.Users[0], "sdfaefawefsdf"); Assert.That(offers.Count, Is.EqualTo(0)); }
public void Select_org() { var payer = DataMother.TestClient().Payers[0]; MakeNameUniq(payer); var org = new LegalEntity(String.Format("Тестовое юр.лицо 2 {0}", payer.Id), payer); payer.JuridicalOrganizations.Add(org); Save(payer); Refresh(); SetupGeneralInformation(); SearchPayer(payer.Name); Assert.That(Css("#PayerComboBox").Options.Count, Is.EqualTo(1)); Assert.That(Css("#PayerComboBox").SelectedItem, Is.StringEnding(payer.Name)); Assert.That(Css("#address_LegalEntity_Id").Options.Count, Is.EqualTo(2)); Css("#address_LegalEntity_Id").Select(org.Name); Click("Зарегистрировать"); var client = GetRegistredClient(); Assert.That(client.Addresses[0].LegalEntity, Is.EqualTo(org)); }
public void can_request_the_errors_screen() { DataMother.LoadMathProject(); var factory = ObjectFactory.GetInstance <IScreenFactory>(); ObjectFactory.GetInstance <GrammarErrorsSubject>().CreateScreen(factory).ShouldNotBeNull(); }
public void Read_in_a_class_with_primitive_arrays() { string xml = @" <Instance> <numbers Values='1,2,3'/> <strings Values='1,2,3'/> </Instance> "; XmlElement element = DataMother.BuildDocument(xml).DocumentElement; element.SetAttribute("PluggedType", typeof(ClassWithStringAndIntArray).AssemblyQualifiedName); var memento = new XmlAttributeInstanceMemento(element); var graph = new PluginGraph(); Instance instance = memento.ReadInstance(new SimplePluginFactory(), typeof(ClassWithStringAndIntArray)); var theObject = (ClassWithStringAndIntArray)instance.Build(typeof(ClassWithStringAndIntArray), BuildSession.ForPluginGraph(graph)); theObject.Numbers.ShouldEqual(new[] { 1, 2, 3 }); theObject.Strings.ShouldEqual(new[] { "1", "2", "3" }); Debug.WriteLine(theObject.GetType().AssemblyQualifiedName); }
public void Autosearch_by_client_id() { //нужно добавить еще одного пользователя что не произошел автовход var client = DataMother.TestClient(c => { c.AddUser(new User(c) { Name = "test", }); c.AddUser(new User(c) { Name = "test", }); }); FlushAndCommit(); browser.TextField(Find.ById("filter_SearchText")).TypeText(client.Id.ToString()); ClickButton("Поиск"); var tableBody = browser.TableBody(Find.ById("SearchResults")); Assert.That(tableBody.TableRows.Count, Is.GreaterThan(0)); Assert.That(tableBody.Text, Is.StringContaining(client.Id.ToString())); Assert.That(browser.Text, Is.Not.StringContaining("По вашему запросу ничего не найдено")); }
public void BuildDecisionWithRules() { // May need to add a Plugin for Decision to Decision labelled "Default" DataMother.WriteDocument("FullTesting.XML"); DataMother.WriteDocument("Array.xml"); DataMother.WriteDocument("ObjectMother.config"); XmlMementoSource source = new XmlFileMementoSource("Array.xml", string.Empty, "Decision"); var container = new Container(x => { x.AddConfigurationFromXmlFile("ObjectMother.config"); x.ForRequestedType <Decision>().AddInstancesFrom(source); }); container.GetInstance <Decision>("RedBlue").Rules.Length.ShouldEqual(2); var d2 = container.GetInstance(typeof(Decision), "GreenBluePurple").ShouldBeOfType <Decision>(); d2.Rules.Length.ShouldEqual(3); d2.Rules[0].ShouldBeOfType <ColorRule>().Color.ShouldEqual("Green"); d2.Rules[1].ShouldBeOfType <ColorRule>().Color.ShouldEqual("Blue"); d2.Rules[2].ShouldBeOfType <ColorRule>().Color.ShouldEqual("Purple"); }
public void FindWaybillsWithClientTest() { // Создаем двух клиентов и документы для них var client = DataMother.CreateTestClientWithAddress(); var documentLog = DataMother.CreateTestDocumentLog(supplier, client); var document = DataMother.CreateTestDocument(supplier, client, documentLog); document.WriteTime = DateTime.Now.AddDays(-1); document.Lines[0].SerialNumber = "123"; var client1 = DataMother.CreateTestClientWithAddress(); var documentLog1 = DataMother.CreateTestDocumentLog(supplier, client1); var document1 = DataMother.CreateTestDocument(supplier, client1, documentLog1); document1.WriteTime = DateTime.Now.AddDays(-1); document1.Lines[0].Product = "123"; Save(document); Save(document1); Flush(); // Ищем накладные только для первого клиента var filter = new ParsedWaybillsFilter { Session = session, Period = new DatePeriod(DateTime.Now.AddDays(-7), DateTime.Now), ClientId = client.Id, ClientName = client.Name }; var documentsInfo = filter.Find(); var testDocument = documentsInfo.FirstOrDefault(d => ((ParsedWaybillsItem)d).SupplierCode == supplier.Id); Assert.That(testDocument, Is.Not.Null); Assert.That(((ParsedWaybillsItem)testDocument).SupplierCode, Is.EqualTo(supplier.Id)); Assert.That(((ParsedWaybillsItem)testDocument).SerialNumber, Is.EqualTo("*")); Assert.That(((ParsedWaybillsItem)testDocument).Product, Is.Null); }
public void Read_a_string_string_dictionary2() { string xml = @" <node> <Pair Key='color' Value='red'/> <Pair Key='state' Value='texas'/> <Pair Key='direction' Value='north'/> </node> "; Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement, typeof(Dictionary <string, string>)); //instance.ShouldBeOfType(typeof (SerializedInstance)); Assert.Fail("NWO"); // var collection = // (Dictionary<string, string>) instance.Build(typeof (Dictionary<string, string>), new StubBuildSession()); // // collection["color"].ShouldEqual("red"); // collection["state"].ShouldEqual("texas"); // collection["direction"].ShouldEqual("north"); }
public void Send_invoice_only_once() { var payer = DataMother.CreatePayerForBillingDocumentTest(); payer.ContactGroupOwner .AddContactGroup(ContactGroupType.Invoice) .AddContact(ContactType.Email, "*****@*****.**"); payer.InvoiceSettings.EmailInvoice = true; Save(payer); var invoice = payer.BuildInvoices(DateTime.Today, new Period(DateTime.Today)).Single(); Save(invoice); Flush(); Close(); task.Execute(); var message = messages.FirstOrDefault(m => m.Body.Contains(String.Format("Счет №{0}", invoice.Id))); Assert.That(message, Is.Not.Null); messages.Clear(); task.Execute(); message = messages.FirstOrDefault(m => m.Body.Contains(String.Format("Счет №{0}", invoice.Id))); Assert.That(message, Is.Null, "Отправили счет повторно"); }
public void BaseTest() { var client = new Client(); IList <BaseItemForTable> result = new List <BaseItemForTable>(); using (new SessionScope()) { ArHelper.WithSession(s => { client = new DataMother(s).CreateClientAndUsers(); var filter = new AnalysisOfWorkDrugstoresFilter(1000); filter.Session = s; filter.Regions = new ulong[] { client.HomeRegion.Id }; filter.AutoOrder = (int)AutoOrderStatus.NotUsed; result = filter.Find(); var appHelper = new AppHelper(context); PrepareHelper(appHelper); foreach (var baseItemForTable in result) { baseItemForTable.SetHelpers(appHelper); } Assert.That(result.Count, Is.GreaterThan(0)); var clientIds = result.Select(r => ((AnalysisOfWorkFiled)r).Id).ToList(); var Id = client.Id.ToString(); Assert.IsTrue(clientIds.Any(r => r.Contains(Id))); }); } }
public void Read_an_int_string_dictionary() { string xml = @" <node> <Pair Key='1' Value='red'/> <Pair Key='2' Value='texas'/> <Pair Key='3' Value='north'/> </node> "; Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement, typeof(IDictionary <int, string>)); //instance.ShouldBeOfType(typeof (SerializedInstance)); Assert.Fail("NWO"); // var collection = // (IDictionary<int, string>) instance.Build(typeof (IDictionary<int, string>), new StubBuildSession()); // // collection[1].ShouldEqual("red"); // collection[2].ShouldEqual("texas"); // collection[3].ShouldEqual("north"); }
public void Add_from_json() { var tempLogin = Generator.Name(); var supplier = DataMother.CreateSupplier(); session.Save(supplier); var ojdJson = _json; _json = _json.Replace("\"Id\":5", string.Format("\"Id\":{0}", supplier.Id)) .Replace("\"PayerID\":5", string.Format("\"PayerID\":{0}", supplier.Payer.Id)) .Replace("testLoginRegister", tempLogin); Prepare(); PrepareController(controller); Flush(); Request.InputStream = new MemoryStream(Encoding.UTF8.GetBytes(_json)); controller.Add(); var user = Registred(); Assert.AreEqual(user.Login, tempLogin); Assert.AreEqual(user.Name, "testComment"); _json = ojdJson; }
public void Notify_abount_modification() { var payer = DataMother.CreatePayerForBillingDocumentTest(); var invoice = new Invoice(payer, DateTime.Now); invoice.Parts.Add(new InvoicePart(invoice, "Мониторинг оптового фармрынка за декабрь", 500, 2, DateTime.Now)); session.Save(invoice); var oldValue = invoice.Period.Clone(); var newValue = new Period(DateTime.Today.Year + 1, invoice.Period.Interval); Request.Params.Add("invoice.Period.Year", newValue.Year.ToString()); Request.Params.Add("invoice.Period.Interval", newValue.Interval.ToString()); Request.Params.Add("invoice.Parts[0].Id", invoice.Parts[0].Id.ToString()); Request.HttpMethod = "POST"; controller.Edit(invoice.Id); controller.SendMails(); var errors = controller.Validator.GetErrorSummary(invoice); Assert.AreEqual(0, errors.ErrorsCount, errors.ErrorMessages.Implode()); Assert.AreEqual(1, Emails.Count); var email = Emails[0]; Assert.AreEqual("Изменен счет", Emails[0].Subject); Assert.That(email.Body, Is.StringContaining(String.Format("Параметр Период изменился с {0} на {1}", oldValue, newValue))); }
public void SetUp() { hierarchy = DataMother.BuildHierarchy( @" t1,Success t2,Failure t3,Success s1/t4,Success s1/t5,Success s1/t6,Failure s1/s2/t7,Success s1/s2/t8,Failure s1/s2/s3/t9,Success s1/s2/s3/t10,Success s1/s2/s3/s4/t11,Success s5/t12,Success s5/s6/t13,Success s5/s6/s7/t14,Success s5/s6/s7/s8/t15,Success s9/t16,Success s9/t17,Success s9/t18,Success "); view = new StubExplorerView(); events = MockRepository.GenerateMock <IEventAggregator>(); explorer = new TestExplorer(view, events, new TestFilterBar(), new TestFilter(), null); explorer.Handle(hierarchy); }
public void Read_in_a_dictionary_type_from_an_attribute_normalized_memento() { string xml = @" <root> <dictionary> <Pair Key='color' Value='red'/> <Pair Key='state' Value='texas'/> <Pair Key='direction' Value='north'/> </dictionary> </root> "; XmlElement element = DataMother.BuildDocument(xml).DocumentElement; element.SetAttribute("PluggedType", typeof(ClassWithDictionary).AssemblyQualifiedName); var memento = new XmlAttributeInstanceMemento(element); Instance instance = memento.ReadInstance(new SimplePluginFactory(), typeof(ClassWithDictionary)); var theObject = (ClassWithDictionary)instance.Build(typeof(ClassWithDictionary), BuildSession.Empty()); theObject.Dictionary["color"].ShouldEqual("red"); theObject.Dictionary["state"].ShouldEqual("texas"); theObject.Dictionary["direction"].ShouldEqual("north"); }
public void description_txt_is_ignored() { var mother = new DataMother("empty"); mother.ToPath("description.txt").WriteEmpty(); var plan = mother.BuildSolutionPlan(); plan.FileIsUnhandled("description.txt").ShouldBeFalse(); plan.Steps.OfType<CopyFileToSolution>().Any().ShouldBeFalse(); }
public void instructions_txt_is_ignored() { var mother = new DataMother("empty"); mother.ToPath(TemplatePlan.InstructionsFile).WriteEmpty(); var plan = mother.BuildSolutionPlan(); plan.FileIsUnhandled(TemplatePlan.InstructionsFile).ShouldBeFalse(); plan.Steps.OfType<CopyFileToSolution>().Any().ShouldBeFalse(); }
public void reads_nuget_declarations() { var mother = new DataMother("nugets"); mother.ToPath(ProjectPlanner.NugetFile).WriteContent(@" FubuCore FubuMVC.Core FubuMVC.StructureMap "); var plan = mother.RunPlanner<ProjectPlanner>(); plan.CurrentProject.NugetDeclarations.OrderBy(x => x) .ShouldHaveTheSameElementsAs("FubuCore", "FubuMVC.Core", "FubuMVC.StructureMap"); }
public void other_files_are_copied() { var mother = new DataMother("copied", false); mother.ToPath("foo.txt").WriteEmpty(); mother.ToPath("bar.txt").WriteEmpty(); mother.ToPath("deep","nested","topic.txt").WriteEmpty(); var plan = mother.BuildSolutionPlan(); plan.Steps.OfType<CopyFileToSolution>().ShouldHaveTheSameElementsAs( new CopyFileToSolution("bar.txt", "copied".AppendPath("bar.txt")), new CopyFileToSolution("foo.txt", "copied".AppendPath("foo.txt")), new CopyFileToSolution("deep/nested/topic.txt", "copied".AppendPath("deep","nested","topic.txt")) ); }
public void can_pick_up_gem_transform() { var mother = new DataMother("gemfile"); mother.ToPath("gems.txt").WriteContent(@" rake,~>10.0 fuburake,~>0.5 "); var plan = mother.RunPlanner<ProjectPlanner>(); plan.Steps.OfType<GemReference>().ShouldHaveTheSameElementsAs( new GemReference("rake", "~>10.0"), new GemReference("fuburake", "~>0.5") ); plan.FileIsUnhandled(plan.Root.AppendPath("gems.txt")).ShouldBeFalse(); }
public void gitignore_directive() { var mother = new DataMother("ignoring"); mother.ToPath("ignore.txt").WriteContent(@"pak*.zip bin obj "); var plan = mother.RunPlanner<ProjectPlanner>(); plan.FileIsUnhandled("ignoring".AppendPath("ignore.txt")) .ShouldBeFalse(); plan.Steps.OfType<GitIgnoreStep>().Single() .Entries.OrderBy(x => x) .ShouldHaveTheSameElementsAs("bin", "obj", "pak*.zip"); }