« first day (306 days earlier)      last day (2874 days later) » 
00:00 - 20:0020:00 - 00:00

20:02
thanks, basically I have problem with this specific line
'vbe.VBProjects.Cast<VBProject>() ...'
what type is VBProjects?
I mean, vbe is a Moq-provided mock of VBE right?
@Mat'sMug right
should send you the code here? (I don't know how to format it properly here)
just paste it, and then click the "fixed font" button and then "send" ;)
ah, let me clean it a bit
one minute
 [TestMethod]
        public void TestCast()
        {
            Mock<VBProject> vbProject = new Mock<VBProject>();
            vbProject.Setup(x => x.Name).Returns("projectName");
            vbProject.Setup(x => x.Protection).Returns(vbext_ProjectProtection.vbext_pp_none);

            var projectList = new VBProject[] {vbProject.Object, vbProject.Object};
            // here is my workaround
            VBProjects vbProjects = new VbProjectFake(projectList);

            Mock<VBE> vbe = new Mock<VBE>();
 public class VbProjectFake : VBProjects
    {

        private IEnumerable<VBProject> _projects;

        public VbProjectFake(IEnumerable<VBProject> projects )
        {
            _projects = projects;
        }

        public VBProject Add(vbext_ProjectType Type)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { return _projects.ToList().Count; }
        }

        public System.Collections.IEnumerator GetEnumerator()
you can't just do vbe.Setup(x => x.VBProjects).Returns(projectList)?
20:09
@Mat'sMug No. You're forgetting that VBProjects is a COM object and has to be a non-generic Enumerable
also that creates 2 project mocks with the same project reference, will fail: var projectList = new VBProject[] {vbProject.Object, vbProject.Object};
Just catching up though
@RubberDuck sure, but the mock is whatever you make it
and we only ever use it as an IEnumerable<VBProject> anyway, no?
Kind of. Still has to adhere to the interface.
Moq handles that
20:10
@Mat'sMug nope it didn't work for me, but let me double check I tried too many options so I might missed that one
Just catching up though. Give me a sec to see what's going on.
@skiwi release early, release often
2
so yes I was right :), it even doesn't compile
oh
well I'm coding in the chat box FWIW ;)
@PetLahev I'm pretty sure you have to set up the GetEnumerator to return something.
as I said no rush, I'll continue with the fake class for now, once we solve it I'll replace it with the Mock instance
20:15
28+15 downloads BTW
@PetLahev Honestly, if you get a decent fake going on... why bother switching to a moq?
So, a little bit of chat coding, but here goes....
@RubberDuck Because less code is better ;)
    var projectList = new List<VBProject>() { mockProject1, mockProject2 };

    var projects = new Mock<VBProjects>();
    projects.Setup(p => p.GetEnumerator()).Returns(projectList.GetEnumerator());
@Mat'sMug Only if it works =;)-
@RubberDuck That includes releasing early early prototypes?
It will. It's just a matter of figuring out the types involved ...
20:20
@skiwi Release it with a 0.1 version number.
31
A: Releasing open source software too soon

RubberDuckTL;DR: Release Early. Release Often. Personal anecdote: I was really excited about the project I was working on. Like, really excited. I couldn't sleep at night excited. So, I pushed my co-dev into releasing v1.0 faster than he wanted to. It was terrible. Nothing worked the way it was suppos...

@RubberDuck yep I tried it
@RubberDuck I do intend it to be a public release, but I'll make sure that everything says it's still an alpha
It sounds like your only big mistake was calling it "v1.0". Generally users expect that to indicate a "finished" product in the sense that it's usable for its purported purpose, free of obvious bugs, etc. "Release early" is good, but users should be informed that they're guinea pigs. — R.. Mar 4 at 17:50
@PetLahev what kind of error happened?
@RubberDuck the famous "Object null reference" I found how the Cast is implemented somewhere on StackOveflow and it really uses generic foreach, don't know why it doesn't work
@RubberDuck did you fix the sln file? So I can commit and you can try if you get time?
Were you able to determine which object was null?
Sounds like a missing Moq setup.
20:23
^^ that
Not yet. Can do around 17:30 or so.
Got my class work done for the week.
*17:30 EST
*in an hour
@RubberDuck sure, take your time, it's not important/critical, we can even skip it for now
No. I want to get it working. I fought with it for a long time already.
Where's the code now @PetLahev can you publish it to a new branch of your fork?
@RubberDuck good question, I don't know :) don't forget, first time I use Git.. I thought I'll continue committing to my forked branch and then make a PR?
20:31
Okay. That's cool. Pushing to that branch will sync the pull request. We can just fix it there. =)
Or... no.
Yeah. Create a new branch so we don't bork the PR and publish it. (push origin branchName)
@RubberDuck wait, I'll create a new branch in my forked project and then make a PR and you will be able to merge it to your project?
is this how it works?
@PetLahev if you push to the branch you made a pull request on, it will update the PR. If you create a new branch, I can submit one to yours, or pull it into ours.
So, yeah. Kind of.
20:50
Are you guys doing yard work?
Do gardeners need to send branch requests?
I don't know. But I'm sure people doing spring cleaning are pushing and pulling branches all about their yard.
2
oh nice!
'grats @RubberDuck!
"Dude"
-1
A: How to match and replace sections of a string in SQL

bf2020Dude - in TSQL I would use charindex to find how many periods are before .com .org .gov .net and etc Then strip out those that are before the main part of the domain name Then strip out those after the main part of the domain name Et voila, you are left with "careerone" and "realestate" upon whi...

22:12
Oh. Hey. I wonder if that's @Blackhawk.
0
A: Change "Tom Smith" into "TSmith"

PhrancisYes, there are ways to improve this. Naming Your naming is of no use to help understand what your script does. Look how much easier this reads with proper, useful names: $inputName = "Tom Smith" ; $firstLetter = $inputName.substring(0,1) $lastName = ($inputName).split(" "); $result = $firstLet...

I trolled the OP's title just a little bit ;)
22:34
@RubberDuck Yup! Just poking around to see what's good :)
@RubberDuck @RubberDuck I'll do that tomorrow. Can test it now but the results don't look good
@Blackhawk It's really @cheezsteak's doing at this point, but there is some really cool stuff in there. =)
@PetLahev No worries. I'll poke it with a stick to see if I can't get it to work. Fixing the pr now.
At one point I was trying to port over some of Java's interfaces to VBA to make things more oop, so this looks cool
I'm gonna try to use it in my stuff to be able to provide feedback and contribute as time allows
22:40
Be wary of the Tree I wrote it in a hurry and I'm not real happy with it.
[retailcoder/Rubberduck] ckuhn203 deleted branch PetLahev-next
23:10
> Added unit test for RenamePresenter

minor refactoring

renamed some variables/namespaces

reverted changes to solution file

Closes #361
> Merge branch 'PetLahev-next' into next
> I fixed the solution file changes (removed them) and squashed the changes into a single commit. Closing the pull request. Thanks @PetLahev!
> added missing parsing project and VBIDE reference
@Duga I need @Mat'sMug to verify that works on his machine when he has a sec. =;)-
#MergingIsFun
Sure. Right after Toy Story 3 :)
Dude.... I love that one.
23:32
> fixed broken rename presenter test
00:00 - 20:0020:00 - 00:00

« first day (306 days earlier)      last day (2874 days later) »